Search code examples
batch-filediscordtaskkill

Taskkill batch file to close not responding apps closes an app that is working and responding


Sorry for the awfully worded title, I have a batch file that runs the command:

"taskkill.exe /F /FI "status eq NOT RESPONDING"

I then attached a shortcut of the file to my task bar so that whenever a program doesn't respond I have quick access to close it.

However, recently it has decided to start closing Discord, despite it responding normally at pretty much all times. I'm not sure why, can anyone help?


Solution

  • Apply a taskkill filter for WINDOWTITLE or IMAGENAME and use the not equal (ne) operator to exclude Discord.

    Discord could be not responding at the moment you are running your script.