Posted - 12/03/2012 : 15:44:52
| Trying to create a job that steps include finding a file; copying that file; then moving the file. Upon completion an email is sent stating that the job was successful, the email subject should contain the source filename...I keep getting error: "Incorrect syntax near 'objfso'. [SQLSTATE 42000] (Error 102) "
Here's what I have so far:
Dim folder, files, newsfileSET objfso = createobject("Scripting.FileSystemObject")SET f = objfso.getfolder("\\server31\C$\test")SET fc = f.filesSET newfile =
FOR each f1 IN fcIF LEFT(f1.name, 16) = "file_" then
objfso.copyfile f1, "\\server31\C$\move"
objfso.movefile f1, "\\server31\C$\move2"
SET files = f.files
FOR each "file_" IN files
nextSET objmessage = createobject("CDO.Message")
objmessage.FROM = "email@example.com"
objmessage.TO = "firstname.lastname@example.org"
objmessage.subject = ("the file called".newfile)
objmessage.textbody = "Job successful."
SET objfso = nothingSET objmessage = nothing