Sergey,
This is great, I followed the link and I'm learning a lot, thanks for sharing this.
Do you know the property that holds the user running the process?, I'm looking back and forth and can't find it.
Also, VFP's Intellisense is not showing the "Terminate" method you used in your example or the "name" property I found in another sample in the WMI documentation for the process object, do you have a link where all of those properties and methods are listed?
TIA
Max
>It's Windows Management Instrumentation (WMI). See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_start_page.asp>
>>this works - but why?
>>What is winmgmts://localhost/root/cimv2
>>I have no evidence that it is on the PC anywhere - I see no help in VFP, Win, nor IE ???
>>
>>
>>>
FUNCTION KillAcrobat()
>>> loCIMV2 = GetObject("winmgmts://localhost/root/cimv2")
>>> loProcesses = loCIMV2.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'Acrobat.exe'")
>>> IF loProcesses.Count > 0
>>> For Each objProcess in loProcesses
>>> objProcess.Terminate(0)
>>> NEXT
>>> ENDIF
>>>
>>> RETURN
>>>ENDFUNC
>>>
...Y soy feliz, bien feliz, asi lo grito;
Mira, que el mundo sepa, que se sepa:
Soy feliz....
...And I'm happy, quite happy, so do I yell it;
Look, so the world knows it, so be known:
I'm happy...
Ismael Rivera "Oye cosita linda"
Previous
Next
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