Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

Thanks

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 dev.chromium.org/developers/design-documents/… –  Matt Oct 19 '10 at 21:31

2 Answers 2

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 vb.net

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
Next
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
Next

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

Your Answer

 
discard

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.