Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
MaritimeMadness
Starting Member
10 Posts |
Posted - 2009-06-18 : 11:11:50
|
| I have a job and I've selected ActiveX and vbscript.Here's my code:Dim WshShell, objFSO, strFolder, objFolder, objFiles, objFileDim objEmail, strBody ,strFrm, strTo, strSubject, iNumErr, errorOccurredset WshShell = CreateObject("wscript.Shell")Set objFSO = CreateObject("Scripting.FileSystemObject")errorOccurred = FalsestrFolder = "C:\IWebPages\BMO\Encrypted" 'folder where files we want are storediNumErr = 0WshShell.CurrentDirectory = strFolderSet objFolder = objFSO.GetFolder(strFolder)Set objFiles = objFolder.Files'On Error Resume NextFor Each objFile In objFiles If Right(objFile.Name,3) = "gpg" Then Dim NewFileName NewFileName = Replace(objFile.Name, ".gpg", "") if objFile.DateCreated > now-7 then '-e = encrypt '-d = decrypt '-r name = the name of the Key used to encrypt aka the recipient '--yes = overwite files If they exist WshShell.Exec("gpg.exe -d --output " + NewFileName + " --passphrase #$9sd898h2n97s76029sa8m -r MaritimeTravel --yes " + strFolder + "\" + objFile.Name) objfso.CopyFile("C:\IWebPages\BMO\Encrypted\" + NewFileName, "C:\IWebPages\BMO\Decrypted" + NewFileName) End If 'catch errors If Err.Number <> 0 Then errorOccurred = True iNumErr = iNumErr + 1 strBody= strBody + _ "Error occured encrypting file: " + objFile.Name + " Error number " + Err.Number + _ " Error Discription: " + Err.Description + vbCr End If End ifNextmsgbox "Done"When I run the job I keep getting an error that says:"Cannot use parentheses when calling a Sub. Error on line 30"Can't figure out what's wrong?Any thoughts? |
|
|
|
|
|
|
|