Re: Trouble killing a process on windows

2007-06-03 Thread Tim Golden
Thomas Nelson wrote: [... re Access Denied error on trying to TerminateProcess ...] [Tim Golden] >> I suppose you might have to adjust your token privs to include, >> say the Debug priv. This is designed to let you take control >> of any process (and terminate it, or whatever). If it looks >> lik

Re: Trouble killing a process on windows

2007-06-02 Thread Thomas Nelson
On Jun 2, 11:43 am, Tim Golden <[EMAIL PROTECTED]> wrote: > Thomas Nelson wrote: > > from subprocess import Popen > > from time import sleep > > import win32api > > war3game = Popen(["C:\Program Files\Warcraft III\Frozen Throne.exe"]) > > sleep(30) > > print "slept for 30" > > print win32api.Termin

Re: Trouble killing a process on windows

2007-06-02 Thread reed
On Jun 2, 12:27 pm, Thomas Nelson <[EMAIL PROTECTED]> wrote: > Hi, I'd like to start a program, run it for a while, then terminate > it. I can do this on linux, but I'm new to working with windows. > Here's my script: > > from subprocess import Popen > from time import sleep > import win32api > wa

[Fwd: Re: Trouble killing a process on windows]

2007-06-02 Thread Tim Golden
Tim Golden wrote: > Thomas Nelson wrote: [... re problem Terminating process ...] >> File "C:\Python24\warcraft\runwar3.py", line 7, in ? >> print win32api.TerminateProcess(int(war3game._handle),-1) >> error: (5, 'TerminateProcess', 'Access is denied.') >> >> I'm logged in as adminstrator.

Re: Trouble killing a process on windows

2007-06-02 Thread Tim Golden
Thomas Nelson wrote: > from subprocess import Popen > from time import sleep > import win32api > war3game = Popen(["C:\Program Files\Warcraft III\Frozen Throne.exe"]) > sleep(30) > print "slept for 30" > print win32api.TerminateProcess(int(war3game._handle),-1) > #print > ctypes.windll.kernel32.Te

Trouble killing a process on windows

2007-06-02 Thread Thomas Nelson
Hi, I'd like to start a program, run it for a while, then terminate it. I can do this on linux, but I'm new to working with windows. Here's my script: from subprocess import Popen from time import sleep import win32api war3game = Popen(["C:\Program Files\Warcraft III\Frozen Throne.exe"]) sleep(30