Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete a running process
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01344979
Message ID:
01345165
Views:
16
Yes, thanks, that should do it.
>Hi,
>
>You can use the PID of your program to avoid killing it, modifying the code you posted in your other post
>
>
>declare integer GetCurrentProcessId in WIN32API
>lnMyProcess = GetCurrentProcessId()
>loCIMV2	= GetObject('winmgmts://' + tcComputer + '/root/cimv2')
>IF TYPE('loCIMV2') = 'O'
>	*!* Check for scanners servers that weren't closed last time program was closed
>	loProcesses	= loCIMV2.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'frtasktimetrack'")
>	IF loProcesses.Count > 0
>		For Each objProcess in loProcesses
>			if objProcess.ProcessId  # lnMyProcess
>				objProcess.Terminate(0)
>			endif
>		NEXT
>	ENDIF
>ENDIF	
>
Previous
Reply
Map
View

Click here to load this message in the networking platform