0

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?

  • Maybe Discord is busy at long times just when you run your task purger. I suggest you to add a line before to see what are the _not responding_ tasks: `tasklist /V /fi "status eq NOT RESPONDING"`. – Little Santi Aug 11 '18 at 23:45
  • After doing this, it does say that discord is one of the not responding apps, not sure why... – Didgeri Duck Aug 11 '18 at 23:57
  • 1
    type `taskkill /?` look into the examples, It shows how you can apply multiple filer expressions: `taskkill.exe /F /FI "STATUS eq NOT RESPONDING" /FI "IMAGENAME ne MyImportantProgram.exe"` – sst Aug 12 '18 at 01:26
  • `NOT RESPONDING` is the process not communicating with the OS. When a progress is busy, possibly waiting for return from a blocking function, then the OS may consider it as `NOT RESPONDING`. That does not mean that it is permanent. It just means the OS may not have the knowledge to determine if a process is *unrecoverable*. If you want to kill a process because it is *unrecoverable*, then OK, though `taskkill` does not have a *unrecoverable* argument. – michael_heath Aug 12 '18 at 04:51

1 Answers1

1

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.

Engineer2021
  • 3,288
  • 6
  • 29
  • 51