2013-02-23 129 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]

相關問題