(转载)如何创建一个以管理员权限运行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' ...
随机推荐
- 一个基于TCP/IP的小项目,实现广播消息的功能。(超详细版)
1.结合现状 功能分析 该功能基于上个项目的改进,主要是通过对服务器端代码的修改,以及对客户端作少许修改,实现开启多客户端时,一个客户端发送消息,达到对所有客户端广播的效果.可参考网吧里的点歌系统,比 ...
- 今天把自己的ocr镜像开源了
docker pull docker.io/zhangbo2008/ocr_docker_byzhang:v1 即可,欢迎下载
- TCP首部介绍
每个T C P段都包含源端和目的端的端口号,用于寻找发端和收端应用进程.这两个值加上I P首部中的源端I P地址和目的端I P地址唯一确定一个T C P连接.有时,一个I P地址和一个端口号也称为一个 ...
- thinkphp session跨域
1 .在config.PHP中添加 'SESSION_OPTIONS'=>array('domain'=>'.caizhimofang.con'),//session配置 'COOK ...
- 收藏!了解UART总线工作原理看这一篇就够了!
原文:玩转单片机 2019-08-24 16:50:29 越学到后面,基础知识更加不能忘记,温故而知新~~ 还记得当年的打印机,鼠标和调制解调器吗?他们都有巨大笨重的连接器和粗电缆,并且必须拧到你的电 ...
- Java_hutool 发起请求
//执行接口 String realUrl = "http://localhost:8091/SzeportCodeService/MSGService/encryptAES"; ...
- 【新词发现】基于SNS的文本数据挖掘、短语挖掘
互联网时代的社会语言学:基于SNS的文本数据挖掘 python实现 https://github.com/jtyoui/Jtyoui/tree/master/jtyoui/word 这是一个无监督训 ...
- java集合类-Set接口
Set集合 Set集合中的对象不按特定的方式排序,只是简单的把对象放入集合中,但是不能包含重复对象. Set集合由Set接口和Set接口的实现类组成,Set接口继承与于Collection接口 Set ...
- 8月清北学堂培训 Day3
今天是赵和旭老师的讲授~ 状态压缩 dp 状态压缩是设计 dp 状态的一种方式. 当普通的 dp 状态维数很多(或者说维数与输入数据有关),但每一维总量很少时,可以将多维状态压缩为一维来记录. 这种题 ...
- apipost 调试微信公众号 小程序,秒生成文档工具
1.将已经鉴权的公众号,小程序接口的 header头信息复制进来 2.设置文档展示字段