How to kill an application in one go when there are multiple instances

At the moment, Slack has hung for me. Some times it's Chrome, sometimes another app.

Right clicking the icon in the task bar and choosing close does not close the application

I want to kill it in Task Manager.

When I open in task manager, it doesn't appear as a running app

enter image description here

When I review the running processes, it appears multiple times

enter image description here

At the moment, I have to close each of those processes individually (and it always seems that a random one will close all the processes)

I'd like to close these in 1 go! Is this possible?


Solution 1:

My go-to method for killing processes of any kind is PowerShell. It's very simple and quick, wildcard support means you don't need to know the exact process name, and it works with multiple instances. You don't usually have to know the exact file path. Although PowerShell is immensely powerful, this trick is quite simple so don't be put off.

WARNING: please take due care! If you killed all processes with the name set to * then I presume every single process would die!

  1. Open PowerShell (doesn't need to be opened as admin unless you get an error message requesting elevation). You can open it by searching "PowerShell" from the start menu, or going to Start > All Apps > Windows PowerShell > Windows PowerShell (Ignore the programs ending with "x86", or "ISE" - they do the same job pretty much)

  2. Type in Kill -name progam where program is the name of the executable. There are various ways of doing this - if I don't know the exact name from memory, I will check the Details tab in Task manager and find the executable name.

  3. Press Enter to run the command.

Example:

I have 3x command prompts open:

enter image description here

Which are shown in Task manager as cmd.exe

enter image description here

Enter the command into PowerShell:

enter image description here

Press enter, and every process running called "cmd" will be killed.

For your case, you can simply enter kill -name slack to kill off all your slack processes in one foul swoop.

Use of wildcards such as * is permitted so to kill off all Dropbox proccesses, I can run kill -name drop* - note that as I haven't run the command from an elevated PowerShell, there are some processes that can't be killed due to permissions. This is easily fixed by opening PowerShell as administrator of course.

enter image description here

Solution 2:

You can do this using taskkill, from an elevated command prompt (cmd run as administrator).

taskkill /F /IM [PROCESS EXE] /T

You need to know the exact .exe file name. To do that you can simply right click one of the slack processes and click "open file location". Here's an example:

I have two obs processes enter image description here

I located the actual .exe by right clicking the process in task manager and clicking "open file location" (obs .exe file)

now, from an elevated command prompt, If I do:

taskkill /F /IM obs64.exe /T

Both of the processes will get killed simultaneously. I hope this answers your question and works for your specific process.