Is there a standard set of return code for Window shell scripts (*.bat files)? I'm looking for something analogous to Linux exit codes, where 0==success and non-zero==failure. I need a way to programmatically check if my shell script failed during execution.
The most common practive is the sames as the Unix standard, so a return code (also called errorlevel in batch files) of 0 is success, whereas anything higher than 0 is an error.
There are a number of related gotchas to look for though - have a look at this guide:
Batch Files - Errorlevels
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With