Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. @rem sets the process exit code to 1. should print "success!" actually prints nothing
  2. cmd /c exit 1
  3. if NOT ERRORLEVEL 0 echo success!
  4.  
  5. @rem prints "success!" as expected
  6. cmd /c exit 1
  7. if errorlevel 1 echo success!
  8.  
  9. @rem prints "failure!" even though the exit code is 0
  10. cmd /c exit 0
  11. if errorlevel 1 echo failure!
  12.  
  13. @rem prints "ERRORLEVEL=1" as expected
  14. cmd /c exit 1
  15. echo ERRORLEVEL=%ERRORLEVEL%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement