Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WMI Service - How To Tell If it is Running?
Message
 
 
To
27/09/2007 09:20:41
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01257135
Message ID:
01257142
Views:
33
This message has been marked as the solution to the initial question of the thread.
Tracy,

Try
oShellApp = CreateObject("Shell.Application")
lcServiceName = "winmgmt"
? oShellApp.IsServiceRunning(lcServiceName)
See also http://www.berezniker.com/display/VFP/Windows+Service+Status

>VFP9, Windows 2000 or Windows XP. Any safe way to determine if WMI service is running before I call something like:
>
>
>loWMIService = GetObject("winmtmts://"+lcComputer+"/root/cimv2"         && error occurs here
>loProcesses  = loWMIService.ExecQuery("SELECT * FROM Win32_Process")
>
>
>I am putting it inside of a TRY...ENDTRY but it doesn't prevent the Moniker Cannot Open File error...
>
>I am trying to determing if the service is not running, is corrupt, or if the user doesn't have the security permissions necessary to see WMI and run ExecQuery. I would like to verify WMI is running, then check for the rights to run execquery...
>
>TIA,
>
>Tracy
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform