赢C#:运行应用程序以管理员身份没有UAC提示 [英] Win C#: Run app as administrator without UAC prompt

查看:786
本文介绍了赢C#:运行应用程序以管理员身份没有UAC提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要我的.exe来始终以管理员没有UAC提示运行中的一个。我的程序将与设置,这将有一次管理员权限进行安装,我需要执行此设置,我的exe将因为没有UAC提示管理员始终执行这样的步骤。

I need one of my .exe to always run as administrator without UAC prompt. My program will be installed with setup, which will have for one time admin rights, and I need to perform such step in this setup that my exe will be always executed as admin without UAC prompt.

我已经找到2解决方案迄今:

I've found 2 solutions so far:

1。
使用定制服务,这将提升计划对我来说。

1. Use custom service, which will elevate the program for me.

2。
使用任务计划

有没有其他的解决办法?一些明显的可能?

Is there any other solution? Some manifest probably?

感谢。

推荐答案

当然你应该,如果你想就把车开UI是使用你的清单中的UI访问标志(见 HTTP做://msdn.microsoft.com/en-us/library/ms742884.aspx )。如果您在受信任位置安装您的应用程序(例如system32)下,它是有符号(的Bleh!),那么当你运行你的应用程序,它便升华到高(为管理员帐户)。

Of course what you are supposed to do if you want to just drive UI is to use the UI access flag in your manifest (see http://msdn.microsoft.com/en-us/library/ms742884.aspx). If you install your application in a trusted location (e.g. system32) and it is signed (bleh!) then when you run your application it will be elevated to high (for an admin account).

签名要求使得它有点恼人,但至少它作为你的代码被诚信度高运行,但不使用管理员令牌稍微降低攻击面。

The signing requirement makes it slightly annoying but at least it reduces slightly the attack surface as your code gets run with high integrity but not with an administrator token.

这篇关于赢C#:运行应用程序以管理员身份没有UAC提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆