How do I return an exit code from a VBScript console application

Philip.ie picture Philip.ie · Oct 9, 2008 · Viewed 84.2k times · Source

I Have an old vbs script file being kicked off by an AutoSys job. Can I, and how do I, return an int return value to indicate success or failure?

Answer

Rob picture Rob · Oct 9, 2008

Try:

WScript.Quit n

Where n is the ERRORLEVEL you want to return