Closing Command Prompt
When working with Command Prompt, it is important to first learn how to exit it.
This page introduces four methods to close Command Prompt.
Close with × Button
This method is common to other windows in Windows, but you can close Command Prompt by clicking the × button in the upper right corner of the Command Prompt window.
This is the button in the upper right corner of the sample below.
When you close Command Prompt this way, commands running in it are terminated as well. However, processes launched as separate windows or GUI apps, for example with the start command, may keep running after Command Prompt is closed.
However, for processes that could cause problems if terminated midway (such as file writing), it is recommended to wait until the process completes normally or terminate it using an appropriate method.
Close from Right-Click Menu
This method is also common to other windows in Windows. Right-clicking the title bar of the Command Prompt window displays a context menu.
Clicking “Close” in that menu will close Command Prompt.
Also, right-clicking the icon in the upper left corner of the window displays the same menu. This menu can also be displayed with Alt + Space.

中小企業経営者のためのRPA入門 RPA導入を成功させる方法

60分でわかる! AIエージェント 超 入門

コマンドラインの黒い画面が怖いんです。

知識・才能ゼロでもらく~に月10万円稼ぐ! よくわかるAI副業超入門
Close with exit Command
Command Prompt has an exit command prepared to terminate the currently running process.
You can close Command Prompt by executing this command.
When you execute the above command, the process you are currently using terminates, and Command Prompt closes.
For details on the exit command, please refer to the following page.
Close with Alt + F4
With the Command Prompt window active, pressing Alt + F4 will close Command Prompt.
Similar to the first method, running commands are terminated as well, so if something is still running, wait for it to finish or interrupt it with Ctrl + C before closing.
Summary
There are four methods to close Command Prompt as described above.
Whichever method you use, running commands are terminated as well, so if something is still running, wait for it to finish or interrupt it with Ctrl + C before closing.
Also, methods other than the exit command are common to other windows in Windows, so it’s useful to remember them.