How do you kill a process by name for all users?

12

3

Currently, I have this command in a .bat file:

taskkill /im process.exe /f /t

However, I would like it to kill process.exe for any and every user who is currently logged in on Windows 10. Is there a way to achieve this? I can only find solutions that pertain to specific users.

I simply want to kill every instance of this process regardless of which user is running it.

I have also tried inserting a wildcard in for username like this, but this doesn't kill any of the processes at all.

NotMyAge2020

Posted 2020-02-11T17:50:25.103

Reputation: 125

2Try taskkill /im process.exe /f /t under the Administrator account. If that doesn't work, you can loop through each user account taken from a list. – user96931 – 2020-02-11T18:10:54.183

1I had been running "taskkill /f /t /im process.exe" through a .bat file. When I selected the file and ran it as an administrator, it killed the process for the other users as well. Thank you! If you answer the question, I'll mark it as answered. – NotMyAge2020 – 2020-02-11T18:19:11.710

Answers

14

Run taskkill /im process.exe /f /t as Administrator.

If you include that command in a .bat file (batch script), you can run the .bat file as an Administrator by:

  1. Create a shortcut for the .bat file
  2. Right-click the shortcut and select properties
  3. In the shortcut tab select "Advanced"
  4. Select "Run as administrator" and click OK

user96931

Posted 2020-02-11T17:50:25.103

Reputation: 377

13

Your command is correct. But you need to open a cmd as administrator first. Open Start, find Command Prompt, right click, open as administrator.

taskkill /im process.exe /f /t

HyperX

Posted 2020-02-11T17:50:25.103

Reputation: 151

1Dude, take it easy, I was writing it and post it, then saw you already post it. see the timestamps... here is my +1 for you btw – HyperX – 2020-02-11T18:21:39.177

1Ok, fine. I'll give you my +1 too. – user96931 – 2020-02-11T18:22:33.800

2Thanks! Im trying to get to 50 so I can comment on questions. Yours should be the accepted answer – HyperX – 2020-02-11T18:23:05.700

1No problem. Good luck :) – user96931 – 2020-02-11T18:23:51.900

2I appreciate the answer as well, thanks! – NotMyAge2020 – 2020-02-11T18:25:31.057

2@HyperX You're up to 50+ rep now, btw (if you haven't already noticed). Happy commenting. =P – Anaksunaman – 2020-02-12T02:26:37.597