Killing processes on win32 
Author Message
 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



Mon, 21 Jun 2004 18:01:26 GMT  
 Killing processes on win32
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

Quote:
> -----Original Message-----

> Sent: Thursday, January 03, 2002 11:01 AM

> 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



Mon, 21 Jun 2004 18:29:09 GMT  
 Killing processes on win32

Quote:

> the pdh (performance data helper) library is only available for
> NT 2k and I think XP.

> [snip]

> To kill a process under win9x you should write a pyd to get the
> process information.

Thanks for the (impressively speedy) response. I'm now off to find
somebody with a copy of MSVC++. <sigh>

--
Graham



Mon, 21 Jun 2004 21:20:57 GMT  
 Killing processes on win32
There are versions of ps and kill for windows.
I use a pipe and parse the return values.

We avoid using Win32 stuff to remain cross platform.

--Darrell

Quote:

> 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?



Tue, 22 Jun 2004 05:16:04 GMT  
 Killing processes on win32

Quote:

> Thanks for the (impressively speedy) response. I'm now off to find
> somebody with a copy of MSVC++. <sigh>

Why not just stick with a standalone utility (we use pskill from
sysinternals)?

Note that you mentioned that 'kill' from the resource kit won't kill
the process.  If that's the case, the odds are good you won't be able
to via the other methods either, since they're all going to eventually
boil down to the same underlying API call.  It may just be wedged.

--
-- David
--
/-----------------------------------------------------------------------\

  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 C{*filter*}Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
\-----------------------------------------------------------------------/



Tue, 22 Jun 2004 07:13:22 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Process.kill for Win32

2. kill a process on Win32

3. Thread#kill doesn't kill processes inside a thread

4. Killing processes without using 'kill'

5. Child process on crashing kills it parent process

6. How can kill all child processes without killing parent process ?

7. os.kill for win32

8. Any Improvements to this process killing script?

9. killing processes

10. Kill a Process before Open Files

11. Find & Kill A Process

12. killing a Rexx process in OS/2

 

 
Powered by phpBB® Forum Software