user2605194
user2605194

Reputation:

Batch file checks if program is responding

I was wondering if there was a way to check if a program was responding or not (the way it appears in taskmgr.exe) Basically I am making my own killer for a GTA game. How I want it to work is the batch file checks every so often if the program is responding correctly or not. If the program doesn't respond for around ten seconds, the task is killed. I have no idea how to check if the program is responding or not with a batch file. If anyone has anything to help out, that would be much appreciated.

Upvotes: 2

Views: 3578

Answers (1)

Monacraft
Monacraft

Reputation: 6620

Using Gary's piece of code:

start "C:\... [path to gta.exe (inclusive)]"
:loop
taskkill /im "[GTA image name]" /fi "STATUS eq NOT RESPONDING"
goto loop

That should work. Just save it and run it every time you want to play GTA, it will start it GTA.

Mona

Upvotes: 2

Related Questions