Scorpys Posted May 21, 2022 Share Posted May 21, 2022 I'm on Windows 10. I have Firefox browsers running and sometimes one or more of them get stuck on "Not Responding". I would like for a way to monitor all the browsers, or do a check every X minutes, and if any of the programs is "Not Responding", to kill it. I found this here and tried it - https://stackoverflow.com/questions/21532437/killing-all-non-responding-applications-with-autoit Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase ; Wait 10 seconds for the a window to appear. Local $hWnd = WinWait("Not Responding", "", 10) ; Wait for 2 seconds before calling the WinKill function. Sleep(2000) ; Kill the window using the handle returned by WinWait. WinKill($hWnd, "") So my understanding is that this checks the title of the browsers, and if it finds "Not Responding" in any browser's title, it kills it. This actually works on a browser that's normally running. But if a browser is stuck on "Not Responding", then it doesn't work I assume this is because if a browser is stuck, then the code above is unable to read the window title. The Stackoverflow thread where I got this solution is from 2014, so perhaps this worked back then for a program that's "Not Responding", but now it doesn't. I don't know. --- I'm thinking perhaps the Task Manager can be used, and the "Not Responding" that's showing there. So something like: You run AutoIT script Script does a check on all (or some specific) task manager processes twice, with 30 seconds apart (to eliminate false positives) The processes that are "Not Responding" on both checks, kill them Can it be done? Link to comment Share on other sites More sharing options...
Werty Posted May 21, 2022 Share Posted May 21, 2022 Maybe use ProcessClose() ? Some guy's script + some other guy's script = my script! Link to comment Share on other sites More sharing options...
mikell Posted May 21, 2022 Share Posted May 21, 2022 You could try a check using _WinAPI_IsHungAppWindow Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now