Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Kill remote process
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01142445
Message ID:
01164127
Views:
14
>>>Is there a way to kill a process that is running remotely? it is a remote server that wasn't closed and is still running because of a program failure.
>>>
>>>Thanks
>>
>>Check If your machine freezes, maybe you can reboot it gracefully from another machine at
>>http://blogs.msdn.com/calvin_hsia/archive/2006/06/08/623408.aspx
>
>Do you know why this program would return unknown COM status on FOR EACH Line in VFP8?
>
>loCIMV2		= GetObject("winmgmts://localhost/root/cimv2")
>loProcesses	= loCimv2.ExecQuery("SELECT * FROM Win32_Process WHERE lower(Name) LIKE 'vfp%'")
>For Each objProcess in loProcesses
>	objProcess.Terminate(0)
>Next
>
Maybe because there is no LOWER() function. Here what works for me:
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


***** OR
loCIMV2        = GetObject("winmgmts://localhost/root/cimv2")
loProcesses    = loCimv2.ExecQuery("SELECT * FROM Win32_Process)
For Each objProcess in loProcesses
    IF UPPER(LEFT(objProcess.Name,3)) == [VFP]
       objProcess.Terminate(0)
    ENDIF
NEXT
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform