【问题标题】:WindowsError: [Error 740] The requested operation requires elevation even after disabling UACWindowsError:[错误 740] 请求的操作即使在禁用 UAC 后也需要提升
【发布时间】:2013-02-08 22:53:27
【问题描述】:

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

command = "abcd.exe"
subprocess.Popen(command,stdout=subprocess.PIPE,stderr=subprocess.PIPE).communicate()

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

然后我收到以下错误:

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

【问题讨论】:

标签: python windows-8 uac elevation


【解决方案1】:

我认为问题在于使用 subprocess.Popen。

我也认为您的问题已经在这里得到了回答: Request UAC elevation from within a Python script?

【讨论】:

【解决方案2】:

您可以尝试使用:

subprocess.call(["abcd.exe"], shell=True)

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

Windows 错误:[错误 740]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-09-26
    • 2011-10-30
    • 2021-09-05
    • 1970-01-01
    • 2014-10-25
    • 2021-11-17
    • 2021-05-18
    • 2011-03-01
    相关资源
    最近更新 更多