windows 8 winform won't autostart when requestedExecutionLevel set to “requireAdministrator”

跟風遠走 提交于 2019-12-23 15:52:09

问题


i created a winform application.

my program needs administrator permissions to work, so i added app.manifest file with the following privileges:

<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
    <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>

i added the program to the windows 8 autostart so it should autostart. when i change the app.manifest to the following line, it loads successfully at start of windows.

<requestedExecutionLevel level="asInvoker" uiAccess="false" />

how can i start my program with windows and still keep its administrator permission?

thanks, shlomi


回答1:


Either separate the functionality that needs high privileges and put it in a Windows Service (you can set the account under which the server starts or the SYSTEM account by default). OR start your application using scheduled tasks (here you can also choose the account/privileges under which your application runs)



来源:https://stackoverflow.com/questions/12875371/windows-8-winform-wont-autostart-when-requestedexecutionlevel-set-to-requiread

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