如何为我的应用程序禁用 UAC
好吧,当我尝试以管理员身份运行我的应用程序时,我会得到以下信息 错误,以及是否允许。
如果我直接运行该应用程序而不是以管理员身份运行,那么这似乎可行。我需要做些什么来摆脱 UAC 吗?不,我不希望用户手动更改 UAC 设置。
我是否需要仅针对我的程序或我需要用于签名的任何证书调整注册表设置?
Well , when ever I am trying to run my application as administrator I am getting the following
error, and whether to allow or not.
If I am running the app directly and not as an administrator then this seems to work. Is there Some thing I need to do to get rid of the UAC , no I dont want user to manually change the UAC settings.
Do I need to tweak registry settings only for my programe or any certificate I need to sign with.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您的进程需要提升其权限。 CodeProject 中有几篇与此相关的文章,但请查看此第一个。
Your process needs to elevate its privileges. There are couple of articles about this in CodeProject but have a look at this one first.
一般来说,您无法禁用UAC。 UAC 的目标是提供针对恶意软件的深度防御。如果 Tojan 可以禁用 UAC,则会适得其反。
您可以做的就是接受UAC的存在,并接受它。您通常不应该以管理员身份运行,因此当您这样做时,出现 UAC 对话框是完全可以的。例如,“自动启动”可以作为每用户设置进行处理,这意味着您不需要成为管理员即可更改它。
In general, you can't disable UAC. The goal of UAC is to provide a defense in depth against malware. It would be counterproductive if an Tojan could just disable UAC.
What you can do is accept that UAC exists, and roll with it. You shouldn't usually run as Administrator, so it's perfectly fine to get a UAC dialog when you do. For instance, Auto Start can be handled as a per-user setting, which means you don't need to be an admin to change that.
作为计算机上的解决方法,您可以创建一个启动应用程序的计划任务,并在常规设置中勾选“以最高权限运行”。然后,使用
schtasks /run /tn "TASKNAMEINQUOTES"
作为链接文本创建指向计划任务的链接。这将调用将在没有 UAC 提示的情况下以提升的权限运行应用程序的任务。更多信息请参见:http://www.howtogeek.com/howto/windows-vista/create-administrator-mode-shortcuts-without-uac-prompts-in-windows-vista/
As a workaround on your machine, you can create a scheduled task that launches your application and tick the "run with highest privileges" in the general settings. Then you create a link to the sheduled task with
schtasks /run /tn "TASKNAMEINQUOTES"
as the link text. This will call the task that will run the application with elvated privileges without the UAC prompt.More on this here: http://www.howtogeek.com/howto/windows-vista/create-administrator-mode-shortcuts-without-uac-prompts-in-windows-vista/
其中
有
ConsentPromptBehaviorAdmin
这样的项目。改变它。In
there is such item as
ConsentPromptBehaviorAdmin
. Change it.将应用程序配置为始终以提升的权限运行:
http://technet.microsoft.com/en-我们/库/cc709691(WS.10).aspx#BKMK_S2
Configure an application to always run elevated:
http://technet.microsoft.com/en-us/library/cc709691(WS.10).aspx#BKMK_S2
我有一个程序(Notepad2)突然需要win-7系统上的管理员权限。看来这很容易改变。
右键单击应用程序,选择属性,转到兼容性选项卡,底部是
取消单击它并确定退出方式。为我工作。
I had a program (Notepad2)suddenly require admin rights on a win-7 system. Seems that this can be changed easily.
Right-click the applicaiton, select properties, go to the compatibility tab, at the bottom is
Unclick it and OK your way out. Worked for me.