How do I get the application exit code from a Windows command line?

后端 未结 7 754
执笔经年
执笔经年 2020-11-22 02:13

I am running a program and want to see what its return code is (since it returns different codes based on different errors).

I know in Bash I can do this by running<

7条回答
  •  长发绾君心
    2020-11-22 02:50

    Use the built-in ERRORLEVEL Variable:

    echo %ERRORLEVEL%
    

    But beware if an application has defined an environment variable named ERRORLEVEL!

提交回复
热议问题