Windows – How to kill a process by name for all users

command linewindowswindows 10

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.

Best Answer

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
Related Question