Stef Mientki wrote: > > I'm trying to kill processes, > I started myself with subprocess.popen, > under windows XP, Python 2.6 > > Why are the subprocess.Popen methods kill() and terminate () not working, > while a simple suggestion from this newsgroup, shown below, works > perfect ? > ... > > My_Process = subprocess.popen ( ...) > handle = win32api.OpenProcess(win32con.PROCESS_TERMINATE, 0, > My_Process.PID) > try: > win32api.TerminateProcess(handle,0) > win32api.CloseHandle(handle) > except: #the process might already be closed by the user > pass
There shouldn't be any difference. If you look at the code in subprocess. it calls the same API. The handle returned from CreateProcess has all access rights, including PROCESS_TERMINATE. Can you show us your original code? -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32