How To Force Exit A Program In CMD On Windows 2024

Home > Guides > How To Force Exit A Program In CMD On Windows 2024

In this Windows 10 and Windows 11 guide, I will be showing you how to force quit a program on Windows using CMD. This is a great way to force and kill the process of any running program, app, or game within the operating system.

Command Prompt (CMD) on Windows provides powerful tools for managing and controlling your system.

Occasionally, you may encounter situations where a program becomes unresponsive, and the standard methods of closing it prove ineffective.

In such cases, force exiting a program through CMD becomes a useful skill and one that you should know.

So as I already said above in this guide, I will walk you through the steps of force exiting a program using Command Prompt on a Windows system.

How To Force Quit a Program In Windows

Step 1: Open Command Prompt

Press the Windows key + R to open the Run dialog.

Type cmd and press Enter to open the Command Prompt.

Step 2: Identify the Process

To force exit a program, you first need to identify its process. You can do this by running the following command:


This command displays a list of all running processes on your system. Look for the name or executable of the program you want to force exit.

Step 3: Find the Process ID (PID)

Once you’ve identified the program, note its Process ID (PID). The PID is a unique number assigned to each running process.

Locate the PID in the “PID” column of the tasklist output.

Step 4: Force Exit the Program

Now that you have the PID, you can force exit the program using the taskkill command. The basic syntax is:

taskkill /F /PID <PID>

Replace <PID> with the actual Process ID of the program you want to terminate.

Example if I wanted to force close cmd.exe:

taskkill /F /PID 12100

The /F flag stands for “force” and ensures that the program is terminated forcefully.

Step 5: Verify Termination

After executing the taskkill command, you can re-run tasklist to verify that the program’s process has been terminated.


If the program is still running, double-check the PID and re-run the taskkill command.


Force exiting a program through Command Prompt can be a handy solution when standard methods fail. However, just remember that forcefully terminating a program may result in data loss or corruption. It’s recommended to save your work before attempting to force exit a program.

ComputerSluggish logo.

We write helpful Windows and gaming guides and develop software to help Windows users.