|
EXIT
Exits the current batch script.
Syntax
EXIT [/B] [exitCode]
Key
/B When used in a batch script, this option will
exit only the script (or subroutine) but not
CMD.EXE
exitCode Sets the %ERRORLEVEL% to a numeric number.
If quitting CMD.EXE, set the process exit code
no.
Remarks
If you use /B outside of a batch script, it will exit Cmd.exe.
Examples
:: Exit if a required file is missing
@echo off
If not exist MyFile.doc Exit /b
Echo The file was found
Cmd Commands
|