WindowsError: [Error 740] The requested operation requires elevation even after disabling UAC

倖福魔咒の 提交于 2019-12-19 04:23:23

问题


I have disabled UAC and running my script in python.

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

Also, I set the application abcd.exe from its property to run as admin.

Then I'm getting the following error:

WindowsError: [Error 740] The requested operation requires elevation


回答1:


You could try using:

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

Basically the important part here is shell=True; if set to False, then you will get the following error.

WindowsError: [Error 740]




回答2:


I believe that the problem is with using subprocess.Popen.

I also think that your question has already been answered here: Request UAC elevation from within a Python script?



来源:https://stackoverflow.com/questions/15039137/windowserror-error-740-the-requested-operation-requires-elevation-even-after

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!