TheWizard78
Programmer
Hi,
I just found on this forum some code for listing all the process running on my computer. The problem is that my computer is a windows server and it also list the process of other user. I would like to see only mine. Is there a way to do it? I'm searching using the exe filename, not the title, but is that possible to retreive it with this function?
here is the code use to verify is the process is running.
LPARAMETERS lcProcess
lcComputer = "."
loWMIService = Getobject("winmgmts:" + "{impersonationLevel=impersonate}!\\" + lcComputer + "\root\cimv2")
colProcessList = loWMIService.ExecQuery ("Select * from Win32_Process")
FOR EACH loProcess IN colProcessList
IF UPPER(loProcess.name)==UPPER(lcProcess)
RETURN .T.
ENDIF
ENDFOR
RETURN .F.
Also, where can I find some help or other great function like this one using the «Getobject("winmgmts:"...», because they are very usefull?
thanks
Robert
I just found on this forum some code for listing all the process running on my computer. The problem is that my computer is a windows server and it also list the process of other user. I would like to see only mine. Is there a way to do it? I'm searching using the exe filename, not the title, but is that possible to retreive it with this function?
here is the code use to verify is the process is running.
LPARAMETERS lcProcess
lcComputer = "."
loWMIService = Getobject("winmgmts:" + "{impersonationLevel=impersonate}!\\" + lcComputer + "\root\cimv2")
colProcessList = loWMIService.ExecQuery ("Select * from Win32_Process")
FOR EACH loProcess IN colProcessList
IF UPPER(loProcess.name)==UPPER(lcProcess)
RETURN .T.
ENDIF
ENDFOR
RETURN .F.
Also, where can I find some help or other great function like this one using the «Getobject("winmgmts:"...», because they are very usefull?
thanks
Robert