2013-02-23 61 views
1

我禁用了UAC并在python中运行脚本。WindowsError:[错误740]即使在禁用UAC后,请求的操作也需要提升

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

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

然后我发现了以下错误:

WindowsError: [Error 740] The requested operation requires elevation

+0

[从Python脚本中请求UAC提升?]的可能的复制(http://stackoverflow.com/questions/130763/request-uac-elevation-from-within-a-python-script) – 2016-09-05 15:10:08

回答

0

我相信这个问题是使用subprocess.Popen。

我也认为你的问题已经在这里找到答案: Request UAC elevation from within a Python script?

+0

感谢您的回复.. :) 解决方案[请求UAC提升从一个Python脚本?](http://stackoverflow.com/questions/130763/request-uac-elevation-from-within-a-python-脚本)为我工作.. – Binoy 2013-03-06 08:32:09

5

你可以尝试使用:

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

基本上这里的重要组成部分,是shell=True;如果设置为False,那么你会得到以下错误。

WindowsError: [Error 740]

相关问题