To close or exit the Windows command line window, also called command or cmd mode or DOS mode, type exit and press Enter.
Alternatively, if the window is not fullscreen, you can click the X close button in the top-right corner of the window.
The exit command can also be placed in a batch file.
You can also use the shortcut key Alt+F4 to close a Command Prompt window.
Related information
- How to use the Windows command line (DOS).
- Microsoft DOS and Windows command line exit command help.
- How to exit a Windows MS-DOS window through a batch file.
- How to shut down a computer.
- MS-DOS and Windows command line help and support.