Windows cmd kill process by name

We can kill a process from windows command line using taskkill command. This article explains taskkill command syntax for various use cases.

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.

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.

it seems that whenever i open a program in windows 8, the process name is WWAHost.exe

i would like to be able to do something like TASKKILL /F /IM notepad.exe and terminate a specific process by name

if i kill WWAHost.exe then all open programs will die.

any ideas?

asked Mar 24, 2015 at 7:39

Patrioticcow's user avatar

PatrioticcowPatrioticcow

25.9k73 gold badges213 silver badges333 bronze badges

2

You can kill the process and all its children (ie. all processes started by it) using the /t switch:

taskkill /f /t /im wwahost.exe

See the documentation for taskkill (ss64) and tskill (ss64) system utilities.

answered Mar 24, 2015 at 12:55

1

How to Identify and Kill Any Process in Windows 10

Contents

  • 1 How to Kill a Process in Windows 10 with Task Manager
  • 2 How to Kill a Process with the Taskkill Command
  • 3 How to Terminate a Process with PowerShell
  • 4 How to Identify the Process of any Open System Dialog or Program Window with Process Explorer
  • 5 How to Kill Any Window-related Process Directly with just Two Clicks

For the most part, Windows 10 programs function just fine, but when one misbehaves it’s often necessary to kill its process. At times, apps can refuse to close, get stuck on a blank screen, or suddenly consume a lot of system resources. Terminating the task will force it to close and free up your system for normal functioning.

Identifying and killing a process of single windows and background apps

There are various ways to kill a process, but all of them make use of an application’s PID (Process ID), a unique identifier that ensures only the correct one is terminated. However, it’s worth noting that terminating a specific application process can still have knock-on effects on the rest of the program’s functions if they rely on it.

The most common way in Windows to terminate a process is through Task Manager. But today we’ll also be covering how to kill a process with PowerShell, how use the taskkill command in Command Prompt, how to find a process ID with Process Explorer (Microsofts ooptional advanced Task Manager) and using a two-click-method via a task bar button.

Different methods to kill a process for different needs

Some programs run several processes at once which means if you want to terminate the application completely you will have to kill all those processes. And there are cases where you will have a program window or system dialog but cannot identify the underlying process. In our tutorial you will find solutions for all of those issues.

How to Kill a Process in Windows 10 with Task Manager

Task Manager is the bread and butter of Windows 10 task killers, providing a simple interface with all the information users need to make informed decisions about which applications they should close. Accessing it is as easy as pressing “Ctrl + Shift + Esc”.

  1. View more details

    After opening Task Manager with “Ctrl + Shift + Esc”, press the “More details” button in the bottom left to view more information.

  2. Select the process you want to kill and click “End task”

    You can also press the “Delete” key instead to save some time.

    Windows 10 - Task Manager - Kill Process

  3. OR: Find an individual process and terminate it

    Click the “Details” tab, find your process, and click “End Task” or press “Delete”.

    Windows 10 - Task Manager - Kill Process in details view

How to Kill a Process with the Taskkill Command

If task manager isn’t an option because you’re using a Windows server install or it’s blocked by your administrator, you can achieve similar results through the use of the taskkill command in Command Prompt.

  1. Open Command Prompt

    Press the Windows key and type “Command Prompt”, then choose “Run as administrator”.

    Windows 10 - Open Elevated Command Prompt

  2. Run the tasklist command

    You can get a quick readout of all the currently running processes, much like Task Manager, by typing tasklist | more and pressing “Enter”

    Windows 10 - CMD admin - tasklist - processes with IDs

  3. Run the taskkill command to kill the process

    Type taskkill /F /PID x, where x is replaced by your process’ PID.

    Windows 10 - CMD admin - taskkill PID

  4. OR: Use taskkill to kill a process by its name

    If you know the name of the process’ .exe file, you can optionally use that to kill the task instead:

    taskkill /IM "yourprocess.exe" /F

    Windows 10 - CMD admin - taskkill process by name

How to Terminate a Process with PowerShell

Alternatively, those familiar with PowerShell can use it kill tasks instead. This has the advantage of quite intuitive commands.

  1. Open PowerShell as an admin

    Press “Windows + X” to open the fly-out menu, then click “Windows PowerShell (Administrator)”.

    Windows 10 - Open PowerShell as Admin

  2. Get a list of processes

    In PowerShell, type Get-Process to have it return a list of all of the currently running processes on your PC and their PID.

    Windows 10 - PowerShell admin - Get-Process (1)

  3. Use PowerShell stop process to kill the task

    To stop the process, type the following, substituting the x for the relevant PID:

    Stop-Process -ID x -Force

    Windows 10 - PowerShell admin - Stop-Process via ID

  4. OR: Kill process by name in PowerShell

    As with command prompt, you can also kill one or more processes at once in PowerShell by their name. This time, however, you’ll need its system name rather than its .exe file. For example:

    Stop-Process -Name "YourPhone" -Force

    Windows 10 - PowerShell admin - Stop-Process via Name

How to Identify the Process of any Open System Dialog or Program Window with Process Explorer

As you’ve likely realized by now, scrolling through a giant list to get the name or PID of an application can be an annoyance. To remedy this, you can use Microsoft’s Process Explorer.

  1. Download Process Explorer

    Head to Microsoft’s Process Explorer documentation and press the “Download Process Explorer” button to download the application.

    Windows 10 - Download Process Explorer

  2. Run Process Explorer

    Head to the folder you downloaded the application to and double-click “Procexp64.exe” or “proxexp.exe” depending on whether your system is 64 or 32-bit.

    Windows 10 - Launch Process Explorer

  3. Kill a process with Process Explorer

    You can use Process Explorer much like Task manager by clicking the application and pressing the ‘x’ button in the top toolbar to stop it.

    Windows 10 - Process Explorer - Kill Process

  4. Optional: Use the identification crosshair

    Alternatively, if you don’t know the name of the application or its process, click the target button in the top toolbar.

    Windows 10 - Process Explorer - Identify Process by Windows

  5. Drag the target to the process you want to identify

    The process will then be automatically selected in the list and you can stop it as normal.

    Windows 10 - Process Explorer - Identify Process by Window - Drag Symbol

Though all of the above methods work just fine, if you find yourself having to kill tasks regularly they still aren’t ideal. For such use cases, we recommend Grizzly Bear’s “Kill”, a tiny 205KB app that you can pin to your taskbar to kill window process with two clicks.

  1. Download Kill

    Go to the dcmembers site and download the Kill.exe freeware by pressing the big blue “Download” button.

    Windows-10-Download-Kill.exe

  2. Pin Kill.exe to the taskbar

    In the kill folder, right-click “Kill.exe” and select “Pin to taskbar”.

    Windows 10 - Pin Kill.exe to Taskbar

  3. Kill any window process with Kill.exe

    To kill a process, simply click the button on your taskbar and then click on the application window.

    Windows 10 - Kill Window-Prcess with two clicks (1)

If you found this tutorial helpful, you may also be interested in our guides about changing process affinity and OneDrive syncing any directory via mklink.

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.Task Manager Windows 10 Show More Details
  3. Select the desired app in the app list.
  4. Click on the End task button or hit the Del key on the keyboard.Kill A Process With Task ManagerKill 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!

Обычно «убить» процесс в Windows 10 можно с помощью диспетчера задач, но в некоторых случаях эта возможность блокируется вирусами или некоторыми программами. Однако, в этих случаях можно попробовать закрыть его через командную строку или PowerShell.

Как убить процесс с помощью командной строки в Windows 10 1

Используя командную строку

Работа диспетчера задач может быть реализована с помощью инструментов командной строки: Tasklist (список задач) и Taskkill (утилита Taskkill).

  • Во-первых, нам нужно найти идентификатор процесса с помощью Tasklist
  • Во-вторых, мы убиваем программу, используя Taskskill.
Task List Memory Usage

Откройте командную строку с правами администратора, введя cmd в строке Выполнить (Win + R) и нажав Shift + Enter.

Для просмотра процессов введите следующую команду и нажмите Enter:

Taskview /fo table

Обратите внимание на идентификатор процесса, указанный в колонке Process ID.

Вы можете также прибить программу, используя точное имя.

Чтобы убить процесс по его имени, введите команду:

TASKKILL /IM "process name" /F

Так для Chrome у программы будет имя chrome.exe.

Введите команду и нажмите Enter, чтобы убить Chrome.

Taskkill /IM chrome.exe /F

Ключ /F используется для принудительной остановки процесса.

Kill a Process using Command Line

Чтобы убить процесс по его PID, введите команду:

TASKKILL /F /PID pid_number

Чтобы убить несколько процессов одновременно, запустите вышеприведенную команду с PID всех процессов через пробел.

TASKKILL /PID 2536 /PID 3316 /F

Используя PowerShell

Чтобы просмотреть список запущенных процессов, выполните следующую команду:

Get-Process

Чтобы убить процесс, используя его имя, выполните следующую команду:

Stop-Process -Name "ProcessName" -Force

Чтобы убить процесс, используя его PID, выполните следующую команду:

Stop-Process -ID PID -Force

Спасибо, что читаете! На данный момент большинство моих заметок, статей и подборок выходит в telegram канале «Левашов». Обязательно подписывайтесь, чтобы не пропустить новости мира ИТ, полезные инструкции и нужные сервисы.


Респект за пост! Спасибо за работу!

Хотите больше постов в блоге? Подборок софта и сервисов, а также обзоры на гаджеты? Сейчас, чтобы писать регулярно и радовать вас большими обзорами, мне требуется помощь. Чтобы поддерживать сайт на регулярной основе, вы можете оформить подписку на российском сервисе Boosty. Или воспользоваться ЮMoney (бывшие Яндекс Деньги) для разовой поддержки:


Заранее спасибо! Все собранные средства будут пущены на развитие сайта. Поддержка проекта является подарком владельцу сайта.

  • Partition Wizard

  • Partition Manager

  • CMD Kill Process: How to Kill Process in Command Prompt

By Ariel | Follow |
Last Updated December 22, 2022

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.

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.

run CMD as administrator

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

Ariel

Position: Columnist

Ariel is an enthusiastic IT columnist focusing on partition management, data recovery, and Windows issues. She has helped users fix various problems like PS4 corrupted disk, unexpected store exception error, the green screen of death error, etc. If you are searching for methods to optimize your storage device and restore lost data from different storage devices, then Ariel can provide reliable solutions for these issues. 

Like this post? Please share to your friends:
  • Windows bootable image creator как пользоваться
  • Windows can t verify the publisher of this driver software
  • Windows cmd delete folder with files
  • Windows boot manager это жесткий диск
  • Windows can t be installed on this drive