设置“以管理员身份运行”自动快捷方式

发布于 2024-09-18 21:31:30 字数 283 浏览 3 评论 0原文

在Windows 7中,您可以将快捷方式的属性设置为“以管理员身份运行”,以便以管理员权限调用应用程序或要求用户提供管理员帐户。

我知道我可以使用应用程序的清单文件请求/强制管理员权限,但我需要为不属于我的应用程序设置权限。作为安装程序软件,我使用 SetUp Factory 8。它将创建一个快捷方式,但不会设置“以管理员身份运行”。

到目前为止,我在安装后手动为每个客户设置了该选项,但这需要大量工作。

如何通过程序/脚本(如编辑快捷方式)或以任何其他方式为应用程序快捷方式设置“以管理员身份运行”。

In Windows 7, you can set a property of a shortcut to "Run as Administrator", so that the application is invoked with Administrator privileges or the user is asked for an admin account.

I know I can request/force Administrator privileges with a manifest file for my application, but I need to set the privileges for applications that are not mine. As Installer Software I use SetUp Factory 8. It will create a shortcut but doesn't set "Run as Administrator".

So far I set the option with every customer manually after install but that is a lot of work.

How can I set "Run as Administrator" for application shortcuts via a program/script (like editing the shortcut) or in any other way.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

弥繁 2024-09-25 21:31:30

您知道可以嵌入清单,但似乎您不知道还可以拥有外部清单。您不需要为此编译可执行文件。只需将文件命名为whatever.exe.manifest,并将其放在与whatever.exe 相同的文件夹中即可。如果该清单显示 requireAdministrator,则您将在每次运行时请求提升。让安装程序在复制 exe 的任何位置复制清单。

You know that you can embed a manifest, but it seems like you don't know you can also have an external manifest. You don't need to compile the executable for this. Just name the file whatever.exe.manifest and put it in the same folder as whatever.exe. If that manifest says requireAdministrator, you'll request elevation on every run. Have your installer copy the manifest wherever it copies the exe.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文