Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using SWbemObjectSet
Message
 
 
À
11/07/2007 16:24:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 2000 SP4
Divers
Thread ID:
01239487
Message ID:
01239513
Vues:
11
>I am trying to implement SWbemObjectSet to find out if my EXE process is running.
>I am using two kinds of SELECT statements:
>loProcesses = loCIMV2.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'exename'")
>loProcesses = loCIMV2.ExecQuery("SELECT * FROM Win32_Process WHERE Name like 'exename%'")
>Both work fine on my XP development box (or so I think), but second statement gives me this:
>OLE IDispatch exception code 0 from SWbemObjectSet: Unspecified error
>on Win2000 box. Any idea?
>
>Thanks

Check http://www.berezniker.com/display/VFP/Windows+Service+Status and
loCIMV2		= GetObject("winmgmts://localhost/root/cimv2")
loProcesses	= loCimv2.ExecQuery("SELECT * FROM Win32_Process WHERE Name LIKE 'vfp%'")
For Each objProcess in loProcesses
	objProcess.Terminate(0)
Next
Works here for me on Windows XP. Not everything is supported on Windows 2000.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform