Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete a running process
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01344979
Message ID:
01345165
Vues:
17
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	
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform