3

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?

2
  • 1
    Your problem with Slack might be that it's hanging on Windows notifications. To avoid using the Windows Action Center, do the following: Go to Slack menu File > Preferences > Notifications, find "Deliver notifications via..." and set it to "Slack's built-in notifications", restart Slack.
    – harrymc
    Commented Dec 10, 2020 at 19:36
  • taskkill /IM "Slack.exe"
    – gregg
    Commented Dec 11, 2020 at 20:59

3 Answers 3

1
+150

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

3

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.

0

You can use a different Task Manager - for example Process Explorer. The "tree" view allows to find the parent process, and terminate it. This will kill also all the other spawned children.

If it is always the same binary that hangs, and you do not care about saving data, you can prepare a link to activate either PSKILL or TASKKILL against that binary. Set the link privileges to "run as administrator" and give it the icon of the explosive from PIFMGR.DLL :-) - then every time you click the detonator icon, the process and all its children are terminated.

PSKILL/TASKKILL are a last resort; I'd rather use Process Explorer if I could at all.

Sometimes (it depends on the process and what it is doing), what happens is that the parent process spawns several children to take care of business, while the parent orchestrates their operations. Now what might happen is that the parent requires some task to be performed (e.g. a status fetched from the command-and-control server). If the program is well coded enough, both a success and a failure will be handled, but it might happen that the child returns neither and remains stuck because its connection has become unresponsive. Lacking confirmation, all the other children remain motionless. The program is not blocked because the parent is still consuming window messages, and it will not terminate because the message asking to do so is intercepted by the parent, who waits for an orderly shutdown of the children - which isn't going to happen.

Process Explorer can also show you the open handles including some kinds of network connections. You can from that sometimes infer which child is stuck, and kill it. Then the parent will receive an error, and either crash or notify the error and retry, or stop, or otherwise continue its business -- which allowed me several times to save my work before restarting the program.

(One process that had the habit of hanging exactly like you describe was a SQL tool when used through a VPN tunnel. A very long and complex query would somehow cause the connecting child to hang, and this usually happened after long creative stints in which I had refined and optimized again and again some query, after a while forgetting to save it before each attempt).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .