python – WindowsError:[错误740]即使在禁用UAC后,请求的操作也需要提升
![python – WindowsError:[错误740]即使在禁用UAC后,请求的操作也需要提升](/upfiles/imgfile/2310/1ER22302223F-164T.jpg)
我已禁用UAC并在python中运行我的脚本.
command = "abcd.exe"
subprocess.Popen(command,stdout=subprocess.PIPE,stderr=subprocess.PIPE).communicate()
另外,我将应用程序abcd.exe从其属性设置为以admin身份运行.
然后我收到以下错误:
WindowsError: [Error 740] The requested operation requires elevation
解决方法:
您可以尝试使用:
subprocess.call(["abcd.exe"], shell=True)
基本上这里重要的部分是shell = True;如果设置为False,则会出现以下错误.
WindowsError: [Error 740]