Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get Process Info Form Remote Computer
Message
 
À
11/01/2008 13:05:43
Steven Dyke
Safran Seats USA
Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01281190
Message ID:
01281219
Vues:
8
Steven,

If you can use WSH and WMI, and you have enough rights (in the example I'll show you; you need domain administrator rights, with other rights it becomes more complicated) then you can use something like this, which will show all the processes running in the local computer or in a remote computer (for local computer you do not need special rights) (if you want to know about just a particular process you pass a second parameter
lparameters tcComputer, tcProcess
local lcComputer, loWMI, loProcess, loProcesses, lcProcess, loLocator

lcComputer			= Iif(Vartype(tcComputer) = 'C' and not Empty(tcComputer), tcComputer, '.')
lcProcess			= Iif(Vartype(tcProcess) = 'C', tcProcess, '')
loLocator			= CREATEOBJECT('WBEMScripting.SWBEMLocator')
loWMI				= loLocator.ConnectServer(lcComputer)
loProcesses			= loWMI.ExecQuery("SELECT * FROM Win32_Process" + Iif(Empty(lcProcess), "", " Where Name = '" + lcProcess + "'"))
clear
For Each loProcess in loProcesses
	with loProcess
		? .ProcessID, .Name, .ExecutablePath, .caption, .commandline, Ctot(Transform(.CreationDate, '@R 9999-99-99T99:99:9999'))
	endwith
Next
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform