Killing processes on win32

Stefan Schukat SSchukat at dspace.de
Thu Jan 3 05:29:09 EST 2002


Hi,

the pdh (performance data helper) library is only available for
NT 2k and I think XP. Under Win9X you must use the "Toolhelp32" functions
to find the process id for a process. But this api hasn't been wrapped
or announced for Python until now. So you are out of luck getting a 
process id under Win9x. To kill a process under win9x you 
should write a pyd to get the process information.

	Stefan

> -----Original Message-----
> From: graham.ashton at cis.co.uk [mailto:graham.ashton at cis.co.uk]
> Sent: Thursday, January 03, 2002 11:01 AM
> To: python-list at python.org
> Subject: Killing processes on win32
> 
> 
> Hi.
> 
> I've run into a bit of a brick wall when trying to kill a process on
> win98. I've read the killProcName.py script that comes with the win32
> extensions, and have seen how it uses win32pdhutil to get a list of
> process IDs that can be passed into win32api.OpenProcess().
> 
> That would be great, if only I had the win32pdh library on this
> platform. When I import win32pdhutil I get an ImportError as win32pdh
> isn't found (I'm using 1.5.2c1. Yes, I know. Unfortunately it's way
> beyond my control).
> 
> I don't know of any way to get a handle to a process other than
> passing a pid to win32api.OpenProcess(). I've not started this process
> from within the script.
> 
> So what I'm looking for is an alternative way of killing a process.
> I've got kill.exe from the win98 resource kit, but it doesn't kill
> this particular process. :(
> 
> Any thoughts?
> 
> --
> Graham
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 




More information about the Python-list mailing list