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

Solution 1:

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