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

后端 未结 2 1720
被撕碎了的回忆
被撕碎了的回忆 2020-12-09 07:15

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?

相关标签:
2条回答
  • 2020-12-09 07:57

    I found the answer :0)

     DIM returnValue
     returnValue = 99
     WScript.Quit(returnValue)
    

    This seems to work well.

    0 讨论(0)
  • 2020-12-09 08:19

    Try:

    WScript.Quit n
    

    Where n is the ERRORLEVEL you want to return

    0 讨论(0)
提交回复
热议问题