How to (what program) kill a process in Windows that has been inactive for X seconds and is running in multiple instances

1

2

I have multiple instances of a programm running and from time to time it stops responding. I need to check if processes of X have not been responding for >X seconds, and if yes, kill this exact process - not all instances of X, but this special one.

Monitoring programms like Kiwi or Process Explorer can only shutdown either process with PID X or ALL instanced of process X.

Can anyone share a programm/script that gives me the ability to solve this problem ?

Closer information: It is a game that i start on different accounts and sometimes the game fails to enter a session and simply stops responding, leading the account to be AFK ingame and simply wait until the session stops and then the account is queueing up again - when this happens often, there are penalties or even bans... If the account enters the session normally nothing goes wrong for anyone.

Lennart Menzel

Posted 2016-03-09T20:55:24.683

Reputation: 19

Answers

2

You can play around the script using :loop , goto loop and timeout exemple :
:loop
taskkill /im "League of Legends.exe" /fi "STATUS eq NOT RESPONDING"
timeout /t 5 /NOBREAK
goto loop

Fayssal Ozilf

Posted 2016-03-09T20:55:24.683

Reputation: 51

does the "/NOBREAK" make it check wether the condition "not responding" is true for the duration of the 5 second timeout ? Because i only want it to kill the task, if it doesn´t respond for >5 seconds - not if it doesn´t respond for 2 seconds and (would) then carry on running – Lennart Menzel – 2016-03-14T01:02:01.687

unfortunately not, the script keeps looping and repeating the same command that terminate the process anytime it finds it "not responding" , the timeout only delay when the next command executes which is after 5 seconds; thus i think u will need to use if and else statements ... i dont know how yet , i will try to figure it out tomorrow morning ___ good night. – Fayssal Ozilf – 2016-03-14T01:55:46.823

0

try process Hacker ....it almost like process explorer but with much advanced options, I'm not sure what your situation is, I hope u provide more informations like : is it a game on browser or something like origin and steam ...ect

Fayssal Ozilf

Posted 2016-03-09T20:55:24.683

Reputation: 51

It´s the game "League of Legends" that is installed as a normal programm and then usually started with a launcher application that updates the game and let´s you queue up for games. I use a console queuer that lets me start multiple accounts at the same time. When the 3rd party launching console is started and logged on the account, it starts the game (League of Legends.exe). Now it can happen that "League of Legends.exe doesn´t respond and simply hangs. The programm should look for "League of Legends.exe" applications and terminate those who aren´t responding for more than 5 seconds – Lennart Menzel – 2016-03-11T08:47:19.583

Sir I think you should try batch script script.bat or script.cmd useing taskkill command in it here is an exemple

taskkill /im "League of Legends.exe" /fi "STATUS eq NOT RESPONDING" – Fayssal Ozilf – 2016-03-12T22:39:10.687

the only problem is that idk how to set it wait for 5 seconds – Fayssal Ozilf – 2016-03-12T22:48:42.513