How to close or exit the Windows command line

Updated: 08/16/2021 by Computer Hope
Windows DOS command prompt window

To close or exit the Windows command line window, also called command or cmd mode or DOS mode, type exit and press Enter.

Tip

The exit command can also be placed in a batch file.

Alternatively, if the window is not fullscreen, click the X close button in the top-right corner of the window.

You can also use the keyboard shortcut Alt+F4 to close a Command Prompt window.