在Windows中终止子进程,拒绝访问

Jes*_*dge 8 python windows subprocess terminate

-

import time
import subprocess
from os.path import expanduser

chrome_path = expanduser('~\Local Settings\Application Data\Google\Chrome\Application\chrome.exe')

proc = subprocess.Popen(chrome_path)
time.sleep(4)
proc.terminate()
Run Code Online (Sandbox Code Playgroud)

输出: WindowsError: [Error 5] Access is denied

如何杀死Chrome进程?

Windows XP上的Python 2.6.

rel*_*ima 0

如果使用 TASKKILL /F /PID [进程 ID 号] 会发生什么?试一试。通过导入操作系统启动它