Windows Batch Tutorial
Introduction First batch program Special characters in Batch programming Accepting user input Operators in Batch scripting Working with variables Integer operations Floating point operations Conditional Statements Looping statements goto statement Writing functions Passing arguments Returning exit codeexit code in windows batch
We can use EXIT command to return the exist code from the batch file. Here is the simple batch file showing how we can return exit code from batch file.
@echo off
dir
IF %ERRORLEVEL% EQU 0 (
echo last command was successful
EXIT /B 0
)
IF %ERRORLEVEL% NEQ 0 (
echo last command was not successful
EXIT /B 1
)
Web development and Automation testing
solutions delivered!!