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