Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Windows Server » microsoft.public.windows.server.scripting
Thread: Application hang on exit?

HTVi
TV Discussion Newsgroups

Application hang on exit?
"Linn Kubler" <lkubler[ at ]chartwellwisc2.com> 12/22/2008 6:18:57 PM
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


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen