.bat file windows code example
Example 1: 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%
)
Example 2: what is a windows batch file
@ECHO OFF
ECHO Congratulations! Your first batch file executed successfully.
PAUSE