(转载)如何创建一个以管理员权限运行exe 的快捷方式? How To Create a Shortcut That Lets a Standard User Run An Application as Administrator
How To Create a Shortcut That Lets a Standard User Run An Application as Administrator

Want to allow a standard user account to run an application as administrator without a UAC or password prompt? You can easily create a shortcut that uses the runas command with the /savecred switch, which saves the password.
Note that using /savecred could be considered a security hole – a standard user will be able to use the runas /savecred command to run any command as administrator without entering a password. However, it’s still useful for situations where this doesn’t matter much – perhaps you want to allow a child’s standard user account to run a game as Administrator without asking you.
We’ve also covered allowing a user to run an application as Administrator with no UAC prompts by creating a scheduled task.
Enabling the Administrator Account
First you’ll need to enable the built-in Administrator account, which is disabled by default.
To do so, search for Command Prompt in the Start menu, right-click the Command Prompt shortcut, and select Run as administrator.

Run the following command in the elevated Command Prompt window that appears:
net user administrator /active:yes

The Administrator user account is now enabled, although it has no password.
To set a password, open the Control Panel, select User Accounts and Family Safety, and select User Accounts. Click the Manage another account link in the User Accounts window.

Select the Administrator account, click Create a password, and create a password for the Administrator account.

Creating the Shortcut
Now we’ll create a new shortcut that launches the application with Administrator privileges.
Right-click the desktop (or elsewhere), point to New, and select Shortcut.

Enter a command based on the following one into the box that appears:
runas /user:%computername%\Administrator /savecred “C:\Path\To\Program.exe“
Replace ComputerName with the name of your computer and C:\Path\To\Program.exe with the full path of the program you want to run. For example, if your computer’s name was Laptop and you wanted to run CCleaner, you’d enter the following path:
runas /user:%computername%\Administrator /savecred “C:\Program Files\CCleaner\CCleaner.exe”

Enter a name for the shortcut.

To select an icon for your new shortcut, right-click it and select Properties.

Click the Change Icon button in the Properties window.

Select an icon for your shortcut. For example, you can browser to CCleaner.exe and choose an icon associated with it. If you’re using an other program, browse to its .exe file and select your preferred icon.

The first time you double-click your shortcut, you’ll be prompted to enter the Administrator account’s password, which you created earlier.

This password will be saved – the next time you double-click the shortcut, the application will launch as Administrator without asking you for a password.
As we mentioned above, the standard user account now has the ability to run any application as Administrator without entering a password (using the runas /savecred command to launch any .exe file), so bear that in mind.
The Administrator password is saved in the Windows Credential Manager – if you want to remove the saved password, you can do it from there.
(转载)如何创建一个以管理员权限运行exe 的快捷方式? How To Create a Shortcut That Lets a Standard User Run An Application as Administrator的更多相关文章
- bat 判断 bat 是否是以管理员权限运行,和自动以管理员权限运行
bat 判断 bat 是否是以管理员权限运行,和自动以管理员权限运行 判断 @echo off net.exe session 1>NUL 2>NUL && ( goto ...
- sharepoint 脚本 强迫以管理员权限运行
#region 关键代码:强迫以管理员权限运行 $currentWi = [Security.Principal.WindowsIdentity]::GetCurrent() $currentWp = ...
- vs2005 ,2008,2010中引入app.manifest(即c#程序在win7下以管理员权限运行方法)
打开VS2005.VS2008.VS2010工程,查看工程文件夹中的Properties文件夹下是否有app.manifest这个文件:如没有,按如下方式创建:鼠标右击工程在菜单中选择“属性”,点击工 ...
- Visual Studio 中用管理员权限运行、调试程序
原文:Visual Studio 中用管理员权限运行.调试程序 一个Sample小程序,用于验证WoW64的Windows Registry的读写访问.在Visual Studio 2010中调试运行 ...
- 如何设置默认以管理员权限运行cmd
设置cmd以管理员权限运行 目的:创建或删除文件等命令时,需要管理员权限运行cmd(linux以root用户登录). 例如,创建日志目录. 方法一: 1.激活administrator用户 2 ...
- RobotFramework环境配置:默认以管理员权限运行cmd
设置cmd以管理员权限运行 目的:创建或删除文件等命令时,需要管理员权限运行cmd(linux以root用户登录). 例如,创建日志目录. 方法一: 1.激活administrator用户 2 ...
- C#程序以管理员权限运行(ZT)
本文转载:http://www.cnblogs.com/Interkey/p/RunAsAdmin.html 在Vista 和 Windows 7 及更新版本的操作系统,增加了 UAC(用户账户控制) ...
- 让InstallShield 2015 Limited Edition for Visual Studio 2015生成的setup.exe双击时以管理员权限运行
转载:http://blog.csdn.net/zztoll/article/details/52096700 如题,如何让InstallShield 2015 Limited Edition for ...
- 如何让QT程序以管理员权限运行(UAC)
方案一:(仅适用于使用msvc编译器) 在PRO文件中添加一行指令即可, QMAKE_LFLAGS += /MANIFESTUAC:"level='requireAdministrator' ...
随机推荐
- DNS域名解析系统介绍
域名系统(D N S)是一种用于T C P / I P应用程序的分布式数据库,它提供主机名字和 I P地址之间的转换及有关电子邮件的选路信息.这里提到的分布式是指在 I n t e r n e t上的 ...
- nginx中ngx_http_gzip_module模块
⽤用gzip⽅方法压缩响应数据,节约带宽gzip on;gzip_min_length 1000;gzip_proxied expired no-cache no-store private auth ...
- 冒泡排序之javascript
冒泡排序是一种简单的排序算法.它重复地走访过要排序的数列,一次比较两个元素,如果它们的顺序错误就把它们交换过来.走访数列的工作是重复地进行直到没有再需要交换,也就是说该数列已经排序完成.这个算法的名字 ...
- sick 激光
sick10:TiM561-2050101https://www.sick.com/cn/zh/detection-and-ranging-solutions/2d-lidar-/tim5xx/tim ...
- 验证码的实现类ValidateCode
package com.yujie.util; import javax.imageio.ImageIO;import java.awt.*;import java.awt.image.Buffere ...
- 图论——最小生成树:Prim算法及优化、Kruskal算法,及时间复杂度比较
最小生成树: 一个有 n 个结点的连通图的生成树是原图的极小连通子图,且包含原图中的所有 n 个结点,并且有保持图连通的最少的边.简单来说就是有且仅有n个点n-1条边的连通图. 而最小生成树就是最小权 ...
- elasticsearch 内部对象结构数据索引
内部对象 经常用于 嵌入一个实体或对象到其它对象中.例如,与其在 tweet 文档中包含 user_name 和 user_id 域,我们也可以这样写: { "tweet": &q ...
- asp.net core spa应用(angular) 部署同一网站下
需求:现在一个应用是前后端开发分离,前端使用angular,后端使用 asp.net core 提供api ,开发完成后,现在需要把两个程序部署在同一个网站下,应该怎么处理? 首先可以参考微软的官方文 ...
- Restorator软件使exe文件都不能打开,exe不支持此接口
遇到的问题: 下载了一个软件Restorator(资源修改器),填写完注册码之后,所有的exe文件都不能打开了,任务管理器不支持此接口打不开. 问题原因: 软件Restorator关联exe文件,运行 ...
- win10 下cuda 9.0 卸载
1.首先 对于cuda8.0.cuda7.5的卸载都可以兼容 安装cuda9.0之后,电脑原来的NVIDIA图形驱动会被更新,NVIDIA Physx系统软件也会被更新(安装低版cuda可能不会被更新 ...