How To Create a Shortcut That Lets a Standard User Run An Application as Administrator

by Chris Hoffman on September 10th, 2012

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.

转载自:https://www.howtogeek.com/124087/how-to-create-a-shortcut-that-lets-a-standard-user-run-an-application-as-administrator/

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

  1. bat 判断 bat 是否是以管理员权限运行,和自动以管理员权限运行

    bat 判断 bat 是否是以管理员权限运行,和自动以管理员权限运行 判断 @echo off net.exe session 1>NUL 2>NUL && ( goto ...

  2. sharepoint 脚本 强迫以管理员权限运行

    #region 关键代码:强迫以管理员权限运行 $currentWi = [Security.Principal.WindowsIdentity]::GetCurrent() $currentWp = ...

  3. vs2005 ,2008,2010中引入app.manifest(即c#程序在win7下以管理员权限运行方法)

    打开VS2005.VS2008.VS2010工程,查看工程文件夹中的Properties文件夹下是否有app.manifest这个文件:如没有,按如下方式创建:鼠标右击工程在菜单中选择“属性”,点击工 ...

  4. Visual Studio 中用管理员权限运行、调试程序

    原文:Visual Studio 中用管理员权限运行.调试程序 一个Sample小程序,用于验证WoW64的Windows Registry的读写访问.在Visual Studio 2010中调试运行 ...

  5. 如何设置默认以管理员权限运行cmd

    设置cmd以管理员权限运行 目的:创建或删除文件等命令时,需要管理员权限运行cmd(linux以root用户登录).   例如,创建日志目录.   方法一: 1.激活administrator用户 2 ...

  6. RobotFramework环境配置:默认以管理员权限运行cmd

    设置cmd以管理员权限运行 目的:创建或删除文件等命令时,需要管理员权限运行cmd(linux以root用户登录).   例如,创建日志目录.   方法一: 1.激活administrator用户 2 ...

  7. C#程序以管理员权限运行(ZT)

    本文转载:http://www.cnblogs.com/Interkey/p/RunAsAdmin.html 在Vista 和 Windows 7 及更新版本的操作系统,增加了 UAC(用户账户控制) ...

  8. 让InstallShield 2015 Limited Edition for Visual Studio 2015生成的setup.exe双击时以管理员权限运行

    转载:http://blog.csdn.net/zztoll/article/details/52096700 如题,如何让InstallShield 2015 Limited Edition for ...

  9. 如何让QT程序以管理员权限运行(UAC)

    方案一:(仅适用于使用msvc编译器) 在PRO文件中添加一行指令即可, QMAKE_LFLAGS += /MANIFESTUAC:"level='requireAdministrator' ...

随机推荐

  1. MySql忘记密码了咋办

    对内 忘记密码终端修改操作: #停止mysql服务 sudo /opt/lampp/lampp stopmysql #参数启动mysqld sudo /opt/lampp/sbin/mysqld -- ...

  2. Ellipsis对象

    Ellipsis对象. 写作 : ‘…’ 中文解释:省略 该对象bool测试是为真 用途: 1.用来省略代码,作用类似于pass的一种替代方案,这是python的’TBD’(未确定内容). def f ...

  3. 时间戳、String、Date转换

    时间戳(String or long) =>Date long s=1557230621043L; Date date=new Date(s); System.out.println(date) ...

  4. change([[data],fn]) 当元素的值发生改变时,会发生 change 事件。

    change([[data],fn]) 概述 当元素的值发生改变时,会发生 change 事件.大理石平台价格表 该事件仅适用于文本域(text field),以及 textarea 和 select ...

  5. 爬虫----异步---高性能爬虫----aiohttp 和asycio 的使用

    前情提要: 首先膜拜loco大佬 肯定有人像我一样.不会异步,发一下. 一:性能比对 多进程,多线程,(这里不建议使用,太消耗性能) 进程池和线程池 (可以适当的使用) 单线程+异步协程   (推荐使 ...

  6. 012_使用死循环实时显示 eth0 网卡发送的数据包流量

    #!/bin/bash while : do echo '本地网卡 eth0 流量信息如下: ' #grep输出所找整行,awk直接输出第5列 ifconfig eth0 | grep "R ...

  7. D. Restore Permutation(权值线段树)

    D. Restore Permutation time limit per test 2 seconds memory limit per test 256 megabytes input stand ...

  8. java经典算法题50道

    原文 JAVA经典算法50题[程序1]   题目:古典问题:有一对兔子,从出生后第3个月起每个月都生一对兔子,小兔子长到第三个月后每个月又生一对兔子,假如兔子都不死,问每个月的兔子总数为多少?1.程序 ...

  9. 【分享】《美国数学本科生,研究生基础课程参考书目(个人整理)》[DJVU][VERYCD]

    目录: 第一学年 几何与拓扑: 1.James R. Munkres, Topology:较新的拓扑学的教材适用于本科高年级或研究生一年级: 2.Basic Topology by Armstrong ...

  10. 以太坊Geth通过私钥导入新地址到钱包步骤(3种方法)

    一: 通过Geth客户端导入私钥: Open TextEdit Paste key into TextEdit without any extra characters or quotations S ...