Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am completely new to Windows. I setup an automation framework on a windows XP box. The browsers brought up by the automation process at times hang and there is no way to recover except killing the browser window. What is a good programmatic solution to this, or a DOS script that can be used to accomplish the same?


share|improve this question
Not sure about that, but on a side note, apparently google chrome tabs are implemented as separate processes (not threads). See… – Matt Oct 19 '10 at 21:31

It wouldn't be easy to script. But you can get the window handle using GetWindow and then call the function IsHungAppWindow. It would be an easy program to write in c# or

share|improve this answer

Try monitoring the browser thread state using VBScript. Here's an example directly from MSDN:

Set objDictionary = CreateObject("Scripting.Dictionary")
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcesses = objWMIService.ExecQuery("SELECT * FROM Win32_Process")
For Each objProcess in colProcesses
objDictionary.Add objProcess.ProcessID, objProcess.Name
Set colThreads = objWMIService.ExecQuery("SELECT * FROM Win32_Thread")
For Each objThread in colThreads
intProcessID = CInt(objThread.ProcessHandle)
strProcessName = objDictionary.Item(intProcessID)
Wscript.Echo strProcessName & VbTab & objThread.ProcessHandle & VbTab & objThread.Handle & VbTab & objThread.ThreadState

share|improve this answer
Thanks. Will try this and let you know! – Sands Oct 21 '10 at 13:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.