How To Kill A Process In Windows 11

Introduction

In this article, you will learn various ways to kill or force-quit a process/program.

Process

A program or application is made up of one or more processes. In its most basic form, a process is a running program. In the context of the process, one or more threads are running. The fundamental unit to which the operating system assigns processing time is a thread. A thread can run any portion of the process code, even bits that are presently being run by another thread.

Windows Program

A Windows-based application is a software that is intended to operate on computers that use the Microsoft Windows operating system. These applications are intended to be installed and operated locally on a Windows computer, and they are often compatible with many versions of Windows. Many Windows-based apps are incompatible with macOS, which is used on Apple computers, while the majority are incompatible with Linux-based machines.

Why kill a process?

  • Process may slow your computer.
  • Process may enter into an infinite loop due to circular waiting, which may cause the system to enter into a hang state.

taskkill

Parameter Description
/s <computer> Specify the name or IP address of a remote computer (do not use backslashes). The default is the local computer.
/u <domain>\<username> Runs the command with the account permissions of the user who is specified by <username> or by <domain>\<username>. The /u parameter can be specified only if /s is also specified. The default is the permissions of the user who is currently logged on to the computer that is issuing the command.
/p <password> Specifies the password of the user account that is specified in the /u parameter.
/fi <filter> Applies a filter to select a set of tasks. You can use more than one filter or use the wildcard character (*) to specify all tasks or image names. The valid filters are listed in the Filter names, operators, and values section of this article.
/pid <processID> Specifies the process ID of the process to be terminated.
/im <imagename> Specify the image name of the process to be terminated. Use the wildcard character (*) to specify all image names.
/f Specifies that processes be forcefully ended. This parameter is ignored for remote processes; all remote processes are forcefully ended.
/t Ends the specified process and any child processes started by it.

To know more, visit.

Method 1: Using Task Manager

Step 1

Open task manager.

Note

Windows 11 doesn't have an option to open task manager from the taskbar unlike earlier versions, you can learn how to open Task Manager in Windows 11, here.

Step 2

Click on the "Processes" tab.

Step 3

Select a process you want to kill, and perform one of the actions below.

  • Press the Delete key.
  • Click on the End task button.
  • Right-click on the process, and click on End task. 

Method 2: Using Command Prompt

Step 1

Open Command Prompt (Cmd).

Step 2

In the command prompt, type "tasklist" and hit the "Enter" key. This program displays a list of all the processes that are presently active on your system.

Step 3

To Kill Process using Process/Image Name

a) Type the following command into the command prompt, to kill only the one Process, and press Enter Key.

taskkill /IM Process Name /F

For Example - To kill Notepad, run the command as, taskkill /IM notepad.exe /F, where /F is used to kill the process forcefully.

b) Type the following command into the command prompt, to kill multiple processes simultaneously, and press Enter Key.

taskkill /IM Process Name /IM Process Name /F

To kill the process using PID

a) Type the following command into the command prompt, to kill only one Process, and press Enter Key.

taskkill /PID PID /F 

For Example - To kill Notepad, run the command as, taskkill /PID 2404 /F, where /F is used to kill the process forcefully.

b) Type the following command into the command prompt, to kill multiple processes simultaneously, and press Enter Key.

taskkill /PID PID  /PID PID /F

Note

To find the PID you can go to the Task Manager, you can right-click on the top, and select PID, as shown in the figure.

Method 3: Using Run Command (Windows+R)

Step 1

From the Start menu, open the Run dialog box or you can Press the "Window + R" key to open the RUN window.

Step 2

To Kill Process using Process/Image Name

a) Type the following command into the run prompt, to kill only the one Process, and press Enter Key.

taskkill /IM Process Name /F

For Example - To kill Notepad, run the command as, taskkill /IM notepad.exe /F, where /F is used to kill the process forcefully.

b) Type the following command into the run prompt, to kill multiple processes simultaneously, and press Enter Key.

taskkill /IM Process Name /IM Process Name /F

To kill the process using PID

a) Type the following command into the run prompt, to kill only one Process, and press Enter Key.

taskkill /PID PID /F 

For Example - To kill Notepad, run the command as, taskkill /PID 2404 /F, where /F is used to kill the process forcefully.

b) Type the following command into the run prompt, to kill multiple processes simultaneously, and press Enter Key.

taskkill /PID PID  /PID PID /F

Conclusion

In this article, we discussed different methods to kill a process in Windows 11.

Visit C# Corner to find answers to more such questions.

If you have any questions regarding any other technology do have a look at the C# Corner Technology Page.


Similar Articles