Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Watched Folder 1

Status
Not open for further replies.

Shfog

Programmer
Aug 24, 2001
20
US
How can I 'watch' a folder to move a file with a name that will vary from day to day?
The customer uploads a file to our server with the name "mmdd(cyclenumber)", where cycle number varies with no pattern.
I've got a timer that runs a stored procedure every few minutes to see if a file has been uploaded, but I don't know how to make the file name variable like:

Name "F:\upload\" & Format(Now, "mmdd") & "*.zip" As "G:\Newfile"

How do I get the wildcard to work?

Thanks
 
'Make a reference to Microsoft Scripting Runtime then do this

Dim fso As New FileSystemObject
On Error Resume Next
fso.MoveFile "F:\upload\" & Format(Now, "mmdd") & "*.zip", "G:\NewFolder\"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top