[python-win32] Any way to get PyHANDLE for any running proces s?
Tim Golden
tim.golden at viacom-outdoor.co.uk
Fri Jul 2 10:58:48 EDT 2004
| I am having a problem of a process not closing when it
| should, actually
| stemming from IE's COM object, and it prevents me from
| creating another
| IE COM object. I would like to have some way to check if
| IEXPLORE.EXE
| is already running, and if so, then kill it.
FWIW, you can do this quite easily with wmi:
<code>
import wmi
c = wmi.WMI ()
for p in c.Win32_Process (Name="IEXPLORE.EXE"):
p.Terminate ()
</code>
TJG
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
More information about the Python-win32
mailing list