|
|
Hi,
I have written a Visual FoxPro application to track my computer inventory. I adopted WMI scripting calls to remotely get information about the CPU, memory, NIC and hard drives from the computer in question. Works pretty slick. However, I've found one quirk that I'd like to correct if I can.
Basically, if I query a computer then shut it down and exit my application it hangs. It's like one of the connections to the computer needs to be dropped by VFP before I shutdown the computer. Any idea how to rectify this issue?
Here is how I connect to the computer: strNamespace = "root\cimv2"
objWbemLocator = CreateObject("WbemScripting.SWbemLocator") THISFORM.objWMIService = ; objwbemLocator.ConnectServer(strComputer, strNamespace, strUser, ALLTRIM(THISFORM.Password)) THISFORM.objWMIService.Security_.authenticationLevel =WbemAuthenticationLevelPktPrivacy
I've tried setting THISFORM.objWMIService = NULL but that doesn't work.
Beyond that I'm just doing a series of Select calls to the computer like this: THISFORM.colCompSystem = THISFORM.objWMIService.ExecQuery ("SELECT * FROM Win32_ComputerSystem")THISFORM.colPhysicalMemory = THISFORM.objWMIService.ExecQuery ("SELECT * FROM Win32_PhysicalMemory WHERE capacity > 16777216")
Any suggestions?
Thanks in advance, Linn
|
|
|