exit 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!!