2019年3月6日 星期三

How to get the application exit code ?

Source https://stackoverflow.com/questions/334879/how-do-i-get-the-application-exit-code-from-a-windows-command-line

BASH
echo $?

Windows
echo Exit Code is %errorlevel%
@echo off
my_nify_exe.exe
if errorlevel 1 (
   echo Failure Reason Given is %errorlevel%
   exit /b %errorlevel%
)

沒有留言: