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.
Is there a standard set of return code for Window shell scripts (*.bat files)?
Share
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