%errorlevel%
evaluates to the return (or error) code of the most recent command (with some exception) that was executed. *.exe
), such as findstr.exe
. exit /b N
to pass a numerical value (N
) to a caller using the %errorlevel%
variable. choice.exe
uses the %errorlevel%
variable to return a number to the caller.