Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @rem sets the process exit code to 1. should print "success!" actually prints nothing
- cmd /c exit 1
- if NOT ERRORLEVEL 0 echo success!
- @rem prints "success!" as expected
- cmd /c exit 1
- if errorlevel 1 echo success!
- @rem prints "failure!" even though the exit code is 0
- cmd /c exit 0
- if errorlevel 1 echo failure!
- @rem prints "ERRORLEVEL=1" as expected
- cmd /c exit 1
- echo ERRORLEVEL=%ERRORLEVEL%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement