Exits the command interpreter or the current batch script.
Syntax
exit [/b] [<exitcode>]
Parameters
| Parameter | Description |
|---|---|
| /b | Exits the current batch script instead of exiting Cmd.exe. If executed from outside a batch script, exits Cmd.exe. |
<exitcode> |
Specifies a numeric number. If /b is specified, the ERRORLEVEL environment variable is set to that number. If you are quitting the command interpreter, the process exit code is set to that number. |
| /? | Displays help at the command prompt. |
Examples
To close the command interpreter, type:
exit
Related links
Source: Microsoft Learn / Windows Server documentation by Microsoft and contributors (upstream author metadata: robinharwood). Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.
