launch C# exe without prompting UAC on Windows 7

白昼怎懂夜的黑 提交于 2019-12-07 00:47:32

Actually you should only be using

requestedExecutionLevel level="requireAdministrator" uiAccess="false"

only when you want to run as administrator.

Change this to:

requestedExecutionLevel level="asInvoker" uiAccess="false"

And you'll be good to go.

Use info.Verb = "runas"; // Provides Run as Administrator

my 50 cents,

instead of adding requestedExecutionLevel level="asInvoker" uiAccess="false" in manifest you can use task scheduler to run almost anything in highest level (Administrator Mode)

source: http://www.liberalcode.com/2014/01/automating-run-as-administrator-from-c.html

although the above post talks about running it remotely, but you can easily change it to run locally.

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