capture any error in VBScript?

后端 未结 5 2222
我在风中等你
我在风中等你 2020-12-09 13:24

I have a batch file that calls a VBScript (.vbs) program. After calling it, my batch script checks %errorlevel% to see if the .vbs program failed. I can signa

5条回答
  •  甜味超标
    2020-12-09 13:57

    You could, if it's an option, use jscript instead which has better support for exception handling, including an easy way to return a non-zero exit code on any exception. See the solution to why does my JScript (windows script host) exit with 0 on an uncaught exception?

    This is the #1 reason we're choosing jscript over vbscript (when we have to use one of the two!)

提交回复
热议问题