I have a batch file that runs a couple executables, and I want it to exit on success, but stop if the exit code <> 0. How do I do this?
You can also use conditional processing symbols to do a simple success/failure check. For example:
myProgram.exe && echo Done!
would print Done! only if myProgram.exe returned with error level 0.
myProgram.exe || PAUSE
would cause the batch file to pause if myProgram.exe returns a non-zero error level.