WindowsError:[错误740]即使在禁用UAC后,请求的操作也需要提升

Bin*_*noy 2 python uac elevation windows-8

我已禁用UAC并在python中运行我的脚本.

command = "abcd.exe"
subprocess.Popen(command,stdout=subprocess.PIPE,stderr=subprocess.PIPE).communicate()
Run Code Online (Sandbox Code Playgroud)

此外,我将应用程序abcd.exe从其属性设置为以管理员身份运行.

然后我收到以下错误:

WindowsError:[错误740]请求的操作需要提升

小智 6

您可以尝试使用:

subprocess.call(["abcd.exe"], shell=True)
Run Code Online (Sandbox Code Playgroud)

基本上这里的重要部分是shell=True; 如果设置为False,则会出现以下错误.

WindowsError:[错误740]