Monday, March 26, 2012

Running a .vbs script as a job

I have created a .vbs scripted that i've tested and works fine when i run it on it's own but when i try to run it as a job on my SQL 2005 i get this error:

Message
Executed as user: OESCCA\MKIMONOS-IT$. Error Code: 0 Error Source= Microsoft VBScript compilation error Error Description: Expected statement Error on Line 0. The step failed.

The Step Type is "ActiveX Script"

i have selected the VBScript Radio button and this is the command

"C:\ESG_COM\WorkFlowProcessorLogFileJanitor.vbs" " C:\ESG_COM\"

the " C:\ESG_COM\" is the directory path of the folder it should process.

Thanks

Marios

Marios,

You would put the code in the vbs file - the script code itself - in an ActiveX Script job.

If you want to execute a vbs script file, you would use a CmdExec job step - you'd execute the script with a command along the lines of:

CScript.exe /NOLOGO C:\YourPath\YourScript.vbs

-Sue

|||

Hey Sue

i tried executing the script with CmdExec but it said this is not a valid 32 app

i didn't realized i had to first put CScript.exe /NOLOGO ... what does that do?

Thanks!!

Marios

|||

Hi Marios,

Cscript.exe is just the command line based host for windows scripts. The /NOLOGO suppresses the banner that you get when you run a script through Cscript.

You can see the options for the exe by typing the following at the command prompt: cscript /?

-Sue

No comments:

Post a Comment