This is a utility that I use. I got it some time ago from the web connection message board, I think Rick Strahl posted it if I remember correctly. I don't know if this is exactly what you are looking for, but maybe it will point you in the right direction.
You can use WMI to do this:
FUNCTION KillProcess(lcExe,lcMachine)
lcMoniker = "winmgmts://" + IIF(!EMPTY(lcMachine),lcMachine + "/","")
oWMI = GETOBJECT(lcMoniker)
loProcesses = oWMI.InstancesOf("Win32_Process")
lcExe = LOWER(lcEXE)
FOR EACH loProcess in loProcesses
IF LOWER(loProcess.Name) = lcExe
IF loProcess.Terminate() = 0
RETURN .T.
ENDIF
ENDIF
ENDFOR
RETURN .F.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only