如何在用户登录windows时自动运行具有管理员权限的程序?

有时,您希望或需要一个程序在登录到Windows后立即以提升的权限自动运行,但如何设置这样的程序?今天的超级用户问答帖子对一个沮丧的读者有一些有用的建议。...

如何在用户登录windows时自动运行具有管理员权限的程序?

有时,您希望或需要一个程序在登录到Windows后立即以提升的权限自动运行,但如何设置这样的程序?今天的超级用户问答帖子对一个沮丧的读者有一些有用的建议。

今天的问答环节是由SuperUser提供的,SuperUser是Stack Exchange的一个分支,是一个由社区驱动的问答网站分组。

由Acid Pix(Flickr)提供的屏幕截图。

问题

超级用户读者Frederick Zhang想知道如何在用户登录时自动运行具有管理员权限的程序:

I am using Windows 8.1 (64-bit) and I would like to automatically run a program with administrator privileges upon user login.

I tried to make a shortcut of the program and ticked the run as administrator check box in the properties of the program shortcut itself, then tried placing the shortcut in the two locati*** shown below, but ticking the box just made it invalid.

  • C:\Users\MyUser\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
  • C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp

Then I edited the program using Resource Hacker to modify its manifest so that administrator privileges were required to run this program. This also made shortcuts under start up directories invalid. After that, I tried to add the program to the following location as well, but it did not work, either.

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

How can I automatically run a program with administrator privileges on user login?

如何在用户登录时自动运行具有管理员权限的程序?

答案

超级用户贡献者Syberdoor为我们提供了答案:

The best way to do this (and the only simple way if you not only want this to run with administrator privileges, but also without UAC prompts) is by creating a scheduled task. With a scheduled task, you can specify which user you want to run it under and that it should run with the highest privileges.

This is probably what you really want because the check box button run as administrator in shortcut properties does trigger UAC prompts rather than really using an administrative user. If you also specify a trigger as on user logon, it should have the same effect as using the startup or run key.

Alternatively, you can use run as with the save credentials option to store the password of another user once and have it cached forever, but it does not work around UAC prompts as far as I know.


有什么要补充的解释吗?在评论中发出声音。想从其他精通技术的Stack Exchange用户那里了解更多答案吗?在这里查看完整的讨论主题。

  • 发表于 2021-04-10 11:36
  • 阅读 ( 174 )
  • 分类:互联网

你可能感兴趣的文章

10安全检查每个人都应该定期进行

... 查看我们关于如何使您的所有社交帐户私有化的指南,以获得完整的说明。 ...

  • 发布于 2021-03-12 17:05
  • 阅读 ( 288 )

在windows中以管理员身份运行任何程序的4种方法

在Windows中打开大多数程序时,即使您已登录到管理员帐户,它们也不会以管理员身份运行。这是由于一个名为用户帐户控制(UAC)的功能,它只允许您在必要时以管理员权限运行应用程序。 ...

  • 发布于 2021-03-19 19:32
  • 阅读 ( 245 )

如何使用nextcloud构建自己的云文件同步

...您熟悉命令行之后,您可以查看提供商的帮助页面,了解如何添加SSH密钥以实现更安全的登录。 如果您的计算机运行的是windows10,那么您需要安装Windows子系统for Linux,并获得一个带有Linux实用程序的bashshell才能继续。如果你使...

  • 发布于 2021-04-02 10:12
  • 阅读 ( 161 )

Windows10中打开powershell的9种方法

...搜索框中键入“powershell”。 现在,单击“打开”或“以管理员身份运行”以正常或以管理员权限打开PowerShell。 通过滚动开始菜单中的所有应用程序 由于PowerShell是默认的Windows10程序,因此可以在“开始”菜单的“所有应用程...

  • 发布于 2021-04-02 10:35
  • 阅读 ( 238 )

你为什么要登录你的家用电脑呢?

...大多数应用程序都使用用户帐户的安全设置运行。有些以管理员身份运行,允许他们完全访问您的系统,您必须同意在启动Windows之前在Windows上提供用户帐户控制(UAC)权限。不同的后台服务和自动化任务作为不同的“用户”帐...

  • 发布于 2021-04-03 04:54
  • 阅读 ( 188 )

如何将windows用户迁移到不同的windows 10 pc

...在旧计算机上,如果只有一个配置文件,请创建一个具有管理员权限的新配置文件。然后切换到它。如果您有多个配置文件,请确保至少有两个具有管理权限,并更改为当前未传输的配置文件。如果您当前已登录到Transwiz,则无...

  • 发布于 2021-04-03 12:57
  • 阅读 ( 201 )

如何删除windows密码

...户上没有密码不会使您更容易受到远程入侵。 如果您使管理员帐户没有密码,从理论上讲,在您的电脑上运行的恶意应用程序可能会获得提升的Windows访问权限。 如果你的Windows PC上只有一个帐户,最好是将Windows设置为自动登录...

  • 发布于 2021-04-04 00:52
  • 阅读 ( 141 )

如何在windows 10中启动时打开windows应用商店应用程序

...到Windows startup,但包括Windows应用商店应用程序。 相关:如何在Windows10的设置应用程序中管理启动程序 为启动文件夹添加快捷方式(适用于任何应用程序) 虽然设置界面帮不了你太多,但是传统的启动程序的方法仍然有效。你...

  • 发布于 2021-04-05 00:08
  • 阅读 ( 142 )

嘿,微软,不要在我的电脑上安装应用程序了

...了。 “微软消费者体验”是对消费者的敌意… 相关:如何摆脱Windows10中的“推荐应用程序”(如Candy Crush) 这一切都要归功于“微软消费者体验”程序,在普通的Windows10家庭或专业系统上不能禁用该程序。这就是为什么你开...

  • 发布于 2021-04-06 18:20
  • 阅读 ( 198 )

如何在一台电脑上使用多个dropbox帐户

...没有一个比这更简单。您需要在主Windows用户帐户上具有管理员权限。然后,按照以下步骤执行: 创建第二个Windows用户(如果您还没有)。这是一个具有自己密码的辅助Windows帐户。如果你只是为了这个Dropbox黑客而创建这个登录...

  • 发布于 2021-04-06 21:28
  • 阅读 ( 278 )
玲玲萌萌
玲玲萌萌

0 篇文章

相关推荐