Windows taskkill by name

We use the taskkill command to terminate applications and processes in the Windows command prompt. Running taskkill is the same as using the End task button in the Windows Task Manager.

With taskkill, we kill one or more processes based on the process ID (PID) or name (image name). The syntax of this command is as follows:

taskkill /pid PID
taskkill /im name

You can use the tasklist command to find the PID or image name of a Windows process.

using the tasklist command to find the PID or image name of a process

Using the tasklist command to find the PID of a Process.

The /F option tells Windows to force kill the process:

taskkill /f /im notepad.exe

Kill a Process by PID

In the following example, we run the taskkill command to terminate a process with a PID of 1000:

taskkill /f /pid 3688

The multiple processes can be terminated at once, as shown in the following example:

taskkill /pid 3688 /pid 4248 /pid 4258

Kill a Process by Name

To kill a process by its name, we use the /IM option. In the following example, we run the taskkill command to terminate the notepad.exe process:

taskkill /im notepad.exe

The /t option tells Windows to terminate the specified process and all child processes. In the following example, we force kill Microsoft Edge and its child processes:

taskkill /f /t /im msedge.exe

Command Options

/S Specifies the IP Address or name of the remote system to connect to.
/U Specifies the name of the Windows user under which the command should execute.
/P Password for the user. Prompts for input if omitted.
/FI This option is to apply filters (see examples below).
/PID Specifies the PID of the process to be terminated.
/IM Specifies the image name of the process to be terminated.
/T Terminates the specified process and its child processes (end all tasks).
/F Forcefully kill a process.

Examples

Terminate a process with a PID of 4000:

taskkill /pid 4000

Terminate spoolsv.exe (which is the Print Spooler service on Windows):

taskkill /im spoolsv.exe

Using /f and /t options to forcefully terminate the entire process tree of the Microsoft Edge browser:

taskkill /f /t /im msedge.exe
taskkill command

Force kill any process that starts with the name note:

taskkill /f /t /im note*

In the following example, we terminate all processes that are not responding by using a filter:

taskkill /f /fi "status eq not responding"

In the above example, eq stands for equal. You can use the following filters with the /fi option.

taskkill filters

Taskkill Filters

Run taskkill command on a remote computer:

taskkill /s 192.168.1.100 /u robst /pid 5936

In the above example, the process with PID 5936 will be terminated on a remote computer with an IP address of 192.168.1.100.

Note that the Windows Firewall must be configured on the remote computer to allow the taskkill command. Click the link below for instructions on how to do it.

How to allow tasklist and taskkill commands from Windows Firewall

All right, here’s the end of this tutorial. While working on the CMD, you can run taskkill /? to display the help page, command options, and filters of the tasklist command.

The PowerShell equivalent to the taskkill is the Stop-Process cmdlet. But you can always use taskkill in PowerShell as well.

When you start an app, the operating system creates a process for an executable file of the app. It contains the program code and its current activity. Windows assigns a special number known as Process Identifier (PID) which is unique for every process. There are a number of reasons you might want to kill a process, and different methods you can use to terminate it. Here is how it can be done.

If an app stops responding, consumes a lot of system resources or behaves unexpectedly and doesn’t allow you to quit it, you might want to kill its process to forcefully close the app. Traditionally, Windows allowed using Task Manager and the command prompt for these tasks. In addition to these methods, you can use PowerShell. Here is how.

To kill a process in Windows 10, do the following.

  1. Open Task Manager.
  2. Click on «More details» in the bottom right corner to enter Full view mode.
  3. Select the desired app in the app list.
  4. Click on the End task button or hit the Del key on the keyboard.
    Task Manager Tab Details

    Kill A Process With Task Manager

You are done.

This is Task Manager’s most well known method.

Note: The same can be done from the Details tab. It is a special tab which lists process names instead of app names. There you can select a process in the list and either click on the End process button or hit the Del key. 

Kill A Process With Task Manager Details Tab

Using the End Task button means Windows first tries to see for a certain timeout if the process has really stopped responding, and attempts to collect a crash or memory dump of the process. It then terminates the app.

Tip: We highly recommend you read the article How to end a process quickly with Task Manager in Windows 10 to learn all Task Manager tricks. Also, you can get the classic Task Manager app in Windows 10 to end processes or tasks.

Another classic method to close a process is the console tool taskill. It comes bundled with modern versions of Windows.

Kill a process using Taskkill

Note: Some processes are running as Administrator (elevated). In order to kill them, you need to open an elevated command prompt instance.

  1. Open the command prompt as the current user or as Administrator.
  2. Type tasklist to see the list of running processes and their PIDs. Since the list might be very long, you can use a pipe character with the more command.
    tasklist | more

    Windows 10 Tasklist

  3. To kill a process by its PID, type the command:
    taskkill /F /PID pid_number
  4. To kill a process by its name, type the command
    taskkill /IM "process name" /F

For example, to kill a process by its PID:

taskkill /F /PID 1242

Windows 10 Taskkill By Pid

To kill a process by its name:

taskkill /IM "notepad.exe" /F

Windows 10 Taskkill By Name

Taskkill supports many useful options which you can use to terminate apps. You can learn them by running it as follows: taskkill /?. Using taskkill, you can close all not responding tasks at once in Windows 10.

Kill a process using PowerShell

Note: To kill a process which runs elevated, you need to open PowerShell as Administrator.

  1. Open PowerShell. If required, run it as Administrator.
  2. Type the command Get-Process to see the list of running processes.
  3. To kill a process by its name, execute the following cmdlet:
    Stop-Process -Name "ProcessName" -Force
  4. To kill a process by its PID, run the command:
    Stop-Process -ID PID -Force

Examples:
This command will close the notepad.exe process.

Stop-Process -Name "Notepad" -Force

Windows 10 Powershell Kill A Process

The next command will close a process with PID 2137.

Stop-Process -ID 2137 -Force

If you need to kill a Store app, see the following article:

How to Terminate Store Apps in Windows 10

That’s it.

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won’t take a lot from you, but it will help us grow. Thanks for your support!

Sometimes when an application in Windows hangs, freezes and stops responding the only way to terminate it is to kill from the command-line.

The taskkill command in Windows serves for terminating tasks by name or by process id (PID).

In this note i am showing how to find and kill a process by its name or by PID and how to identify a process by the listening port.

I am also showing how to troubleshoot “The process could not be terminated” and “Access denied” errors.

Cool Tip: Get the return code from the last command or application! Read more →

List all Windows processes and find the full name of a process to kill (case insensitive):

C:\> tasklist | findstr /I process_name

Kill the process by name:

C:\> taskkill /IM process_name.exe

Kill Process by PID

List all Windows processes and find the PID of a process to kill (case insensitive):

C:\> tasklist | findstr /I process_name

Kill the process by PID:

C:\> taskkill /PID process_id

Kill Process by Port

List all Windows processes listening on TCP and UDP ports and find the PID of a process running on a specific port:

C:\> netstat -ano | findstr :port

Find the name of a process by its PID:

C:\> tasklist /FI "pid eq process_id"

Kill the process by name or by PID:

C:\> taskkill /IM process_name.exe
- or -
C:\> taskkill /PID process_id

Cool Tip: Windows grep command equivalent in CMD and PowerShell! Read more →

Troubleshooting

Kill the process forcefully in case of the following error:

ERROR: The process with PID XXX could not be terminated.
Reason: This process can only be terminated forcefully (with /F option).

C:\> taskkill /F /IM process_name.exe
- or -
C:\> taskkill /F /PID process_id

If you get an “Access is denied” error, you should open the command prompt as an administrator:

ERROR: The process with PID XXX could not be terminated.
Reason: Access is denied

To run the CMD as an administrator, press ⊞ Win keybutton to open the start menu, type in cmd to search for the command prompt and press Ctrl + Shift + Enter to launch it as administrator.

Was it useful? Share this post with the world!

  • Home
  • Partition Manager
  • CMD Kill Process: How to Kill Process in Command Prompt

CMD Kill Process: How to Kill Process in Command Prompt

By Ariel | Follow |
Last Updated

A log of users are unclear about how to kill process CMD/PowerShell in Windows 10/11. Don’t worry. This post of MiniTool walks you through detailed steps on the PowerShell/CMD kill process operations.

Why You Need to Use Windows PowerShell/CMD Kill Process

As you know, the operating system will create a process for the executable file when you start running an app. This process contains the program code and its current activity. In addition, you can find the Process Identifier (PID) assigned by Windows to identify each process.

Sometimes you have to kill a process if an app is not responding or behaves unexpectedly, system resources are much occupied, or other reasons. When it comes to killing a process, most people may open Task Manager by pressing Ctrl + Shift + Esc keys and then right-click the Process and select End task.

select End task

Tip: Also, you can navigate to the Details tab in Task Manager to check the Process ID (PID), Status, CPU, User name, and Memory usage.

Sometimes, however, Task Manager may run into various issues such as “end task not working”, “Task Manager not responding”, “Task Manager has been disabled by your administrator”, and so on. In this case, you can kill process CMD/PowerShell. How to make CMD kill process IN Windows 10/11? Let’s keep reading.

Tips:

Experience peak PC performance with MiniTool System Booster — Free up RAM for a smoother computing journey.

MiniTool System Booster TrialClick to Download100%Clean & Safe

How to Kill Process CMD/PowerShell in Windows 10/11

This part will show you how to kill process Windows command line/PowerShell. You can choose one according to your preference.

# 1. CMD Kill Process

How to let CMD kill process in Windows 10/11? Here you need to use the taskkill command that allows a user to kill a task from a Windows command line by PID or image name. This command works like the “End task” option in Task Manager.

Here’s how to kill task CMD via the taskkill command. Since some apps may run as administrators, you need to open an elevated Command Prompt window to kill them. For that:

Step 1. Type cmd in the Search box, and then right-click the Command Prompt window and select Run as administrator. Then click on Yes in the UAC window to confirm the admin access.

Step 2. In the elevated command prompt window, type the following command and hit Enter to show all the currently running processes in your system.

tasklist | more

run tasklist command in the elevated Command Prompt window

Step 3. To kill a process by its PID, run the following command. Here we take PID 1704 for example.

taskkill /F /PID pid_number

terminate a task using cmd

If you want to kill task CMD by its name, run the following command. For example, to kill the YourPhone.exe process:

taskkill /IM “process name” /F

kill a process CMD by its name

If you want to kill multiple processes by their name simultaneously, run the following command:

taskkill /IM Process Name /IM Process Name /F

kill multiple processes simultaneously by their name

If you want to kill multiple processes by their PID simultaneously, run the following command:

taskkill /PID PID  /PID PID /F

kill multiple processes simultaneously by its PID

If you want to learn more taskkill commands, you also can run the taskkill /? Command.

run Taskkill command to know details

# 2. PowerShell Kill Process

In addition, you can make Windows kill process command line via PowerShell. Here’s how to do that:

Step 1. Type PowerShell in the Search box, and then right-click the Windows PowerShell app and select Run as administrator. Then click on Yes to confirm that.

Step 2. In the elevated PowerShell window, type the following command and hit Enter to show all the running processes on your system.

Get-Process

run get process in PowerShell

Step 3. If you want to kill a process by its name, run the following command.

Stop-Process -Name “ProcessName” -Force

If you want to kill a process by its PID, run the following command.

Stop-Process -ID PID -Force

About The Author

Position: Columnist

Ariel has been working as a highly professional computer-relevant technology editor at MiniTool for many years. She has a strong passion for researching all knowledge related to the computer’s disk, partition, and Windows OS. Up till now, she has finished thousands of articles covering a broad range of topics and helped lots of users fix various problems. She focuses on the fields of disk management, OS backup, and PDF editing and provides her readers with insightful and informative content.

We can kill a process from GUI using Task manager. If you want to do the same from command line., then taskkill is the command you are looking for. This command has got options to kill a task/process either by using the process id or by the image file name.

Kill a process using image name:

We can kill all the processes running a specific executable using the below command.

taskkill /IM executablename

Example:
Kill all processes running mspaint.exe:

c:\>taskkill /IM mspaint.exe
SUCCESS: Sent termination signal to the process "mspaint.exe" with PID 1972.

Kill a process forcibly

In some cases, we need to forcibly kill applications. For example, if we try to to kill Internet explorer with multiple tabs open, tasklist command would ask the user for confirmation. We would need to add /F flag to kill IE without asking for any user confirmation.

taskkill /F /IM iexplore.exe

/F : to forcibly kill the process. If not used, in the above case it will prompt the user if the opened pages in tabs need to be saved.

To kill Windows explorer, the following command would work

C:\>taskkill /F /IM explorer.exe
SUCCESS: The process "explorer.exe" with PID 2432 has been terminated.

The above command would make all GUI windows disappear. You can restart explorer by running ‘explorer’ from cmd.

C:\>explorer

Not using /F option, would send a terminate signal. In Windows 7, this throws up a shutdown dialog to the user.

C:\>taskkill /IM explorer.exe
SUCCESS: Sent termination signal to the process "explorer.exe" with PID 2432.
C:\>

Kill a process with process id:

We can use below command to kill a process using process id(pid).

taskkill /PID  processId

Example:
Kill a process with pid 1234.

taskkill /PID 1234

Kill processes consuming high amount of memory

taskkill /FI "memusage gt value"

For example, to kill processes consuming more than 100 MB memory, we can run the below command

taskkill /FI "memusage gt 102400"

More examples

Sometimes applications get into hung state when they are overloaded or if the system is running with low available memory. When we can’t get the application to usable state, and closing the application does not work, what we usually tend to do is kill the task/process. This can be simply done using taskkill command.

To kill Chrome browser from CMD

Taskkill /F /IM Chrome.exe

Kill Chromedirver from command line

Taskkill /F /IM Chromedriver.exe

To kill firefox browser application

taskkill /F /IM firefox.exe

To kill MS Word application(Don’t do this if you haven’t saved your work)

taskkill /F /IM WinWord.exe

Sometimes, the command window itself might not be responding. You can open a new command window and kill all the command windows

taskkill /F /IM cmd.exe

This even kills the current command window from which you have triggered the command.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Командная строка windows задержка выполнения
  • Не видит тачпад на ноутбуке windows 10 lenovo
  • C windows system32 catroot2 edb log не удается открыть 4
  • Создание загрузочной флешки с несколькими установочными образами windows
  • Openoffice calc for windows 10