Creating and terminating a process using win32process
by Mike Elkins other posts by this author
Nov 17 2005 2:55PM messages near this date
view in the new Beta List Site
Re: python com server clean up problem
|
Re: Creating and terminating a process using win32process
I'm trying to port some python code that uses the Popen3 class returned from
popen2.popen3 on linux. This isn't available on windows, so I thought I'd
try it using win32process.
I figured out a way to call win32process.CreateProcess that actually spawns
a process, but calling win32process.TerminateProcess on the handle it
returns fails with 'Access Denied'.
What would be the typical way someone would spawn a process and later kill
it?
Sample Code:
import win32process
si = win32process.STARTUP_INFO()
details = win32process.CreateProcess('foo.exe','foo.exe
',None,None,False,0,None,None,si)
win32process.TerminateProcess(details[0],99)
Attachments:
unknown1
unknown2
unknown3
unknown4
Thread:
Mike Elkins
Trent Mick
|