Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WMI Service - How To Tell If it is Running?
Message
De
27/09/2007 09:37:54
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01257135
Message ID:
01257147
Vues:
24
Thanks Sergey, I'll try it...


>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
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform