Home: Perl Programming Help: Win32 Programming Help:
How do you terminate a Win32 (WMI) call?

New User

Aug 9, 2010, 6:43 AM

Views: 10219
How do you terminate a Win32 (WMI) call?

I'm using the Win32::OLE->CreateObject('WbemScripting.SWbemLocator') method to make WMI calls to remote machines. However, there are times that the WMI call/query takes several minutes to either come back with or without information. I want to set a time limit on the WMI call and then terminate it without existing the Perl script. I'm also using an eval with alarm(10) and syntax similar to $service = $locator->ConnectServer($machine, "root\\cimv2", $un, $pw)
The eval does not terminate the call after 10 seconds like I was hoping it would.

Does anybody have any suggestions? I would greatly appreciate it. Thank you.