On Microsoft Windows, an application can stop responding, and closing it using the GUI might be impossible. If you have ever found yourself in such a situation, I can tell you that you can close such an application using the Windows command line utility. The following steps are how to go about it.
1. Open the Windows CMD
There are several ways to do this. You can click the Start menu icon (on Windows 11) and search for Command Prompt. Or, if you want, you can open CMD by doing the following:
- Open the Windows Run dialog box by pressing and holding both the Windows Key and R on your keyboard.
- Type
cmdand press theenterkey on your keyboard.
2. Search for the Application
Note the name of the application that you'd like to forcefully shut down. Then type the following in the CMD. The successful execution of the following command will list all the current running applications for the current user (which is your user account).
tasklist
3. Note the Application's Process ID
From the output of the tasklist command, note the PID of the application that you want to close. For example, we would like to close the application Typora and it has many PID as seen below. Meanwhile, the first PID i.e., 8576 is all we need for now.
Typora.exe 8576 Console 1 108,700 K
Typora.exe 9392 Console 1 116,552 K
Typora.exe 2052 Console 1 43,556 K
Typora.exe 11464 Console 1 185,476 K
cmd.exe 9424 Console 1 5,900 K
conhost.exe 11052 Console 1 9,856 K
OpenConsole.exe 11424 Console 1 19,424 K
WindowsTerminal.exe 11096 Console 1 94,264 K
tasklist.exe 7664 Console 1 11,664 K
4. Close the Application by Force
Armed with the application's PID, you can terminate it by force using the taskkill command. Now, to terminate an application using the tasskill command, you need to pass it the /f flag, the /PID flag, and the PID number itself. For example, taskkill /f /PID [N]. Where N is the PID number. From the output of tasklist in the previous step, that's 8576 for Typora.
Therefore, we'll enter the following. In your case, replace 8576 with the process ID that you got from step 3. Then click the Enter key on your keyboard to complete the operation.
taskkill /f /PID 8576
5. Visual Confirmation
The GIF image below shows all the previous steps in action.

Top comments (0)