EXIT

Terminates the current command prompt or batch script.

EXIT [/B] [exitCode]

Where:

  • /B - Specifies the termination of the current cmd batch. If run outside of a batch script, it will terminate cmd.
  • exitCode - Specifies the exit code. If /B is specified, sets ERRORLEVEL to that number (see IFIF). If cmd.exe exits, it sets the process exit code to that number.

Example: End the current batch script (or command prompt):

exit /b

Comments