batch function code example
Example: bat stop if call command fails
The ERRORLEVEL environment variable holds the latest return value:
IF %ERRORLEVEL% NEQ 0 (
echo "Previous command execution failed."
exit %ERRORLEVEL%
)
The ERRORLEVEL environment variable holds the latest return value:
IF %ERRORLEVEL% NEQ 0 (
echo "Previous command execution failed."
exit %ERRORLEVEL%
)