I am trying to use the "Renaming a Source File that Uses Today's Date in its Name" from the IM Script Library but am running into a syntax problem. I'm pretty sure it is because I have a space in the file name, but not sure how to correct. The error occurs on Line 12:
' Added by the IM Script Library
' Category: General Purpose Scripts
' Script Type: After Query Script
'Set the Path & Filename of the Source file and the Destination
'file. In this example, the destination file is named "Done 20000829",
'where "20000829" represents the system date, in the following
'format: yyyymmdd.
sSourceFile = "\\2k3-dfsql\Payroll\ABC AP_Upload.txt"
sDestinationFile = "\\2k3-dfsql\Payroll\Backup Garnishments\ABC AP_Upload & Year(Date) & Right("0" & Month(Date), 2) & Right("0" & Day(Date), 2) & ".txt"
'Create a File System Object
Dim pFSO
Set pFSO = CreateObject("Scripting.FileSystemObject")
'Copy and rename the file
'The "True" parameter indicates that if the file already exists
'in the destination, then it will be overwritten
Call pFSO.CopyFile(sSourceFile, sDestinationFile, True)
Thank you for your help!
*This post is locked for comments