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. watch 监控的新旧值一致问题处理

    watch 监控的新旧值一致问题处理 http://www.imooc.com/article/details/id/286654

  2. .net 后台页面统一验证是否登录

    首先新写一个PageBase类 using System; using System.Collections.Generic; using System.Web; namespace Departme ...

  3. C指针与数组

    通过指针遍历数组的小把戏 #include<stdio.h> #include<stdlib.h> #include<Windows.h> void main() ...

  4. 4、Spring Boot 2.x 自动配置原理

    1.4 Spring Boot 自动配置原理 简介 spring boot自动配置功能可以根据不同情况来决定spring配置应该用哪个,不应该用哪个,举个例子: Spring的JdbcTemplate ...

  5. P4317 花神的数论题 动态规划?数位DP

    思路:数位$DP$ 提交:5次(其实之前A过,但是调了调当初的程序.本次是2次AC的) 题解: 我们分别求出$sum(x)=i$,对于一个$i$,有几个$x$,然后我们就可以快速幂解决. 至于求个数用 ...

  6. ActiveMQ C#实例

    重点参考:NMS Documentation 一.ActiveMQ Queue 在ActiveMQ中Queue是一种点对点的消息分发方式,生产者在队列中添加一条消息,然后消费者消费一条消息,这条消息保 ...

  7. 【LeetCode-86】分隔链表

    [题目描述] 给定一个链表和一个特定值 x,对链表进行分隔,使得所有小于 x 的节点都在大于或等于 x 的节点之前. 你应当保留两个分区中每个节点的初始相对位置. 示例: 输入: head = 1-& ...

  8. rtp发送 h265

    自己写的select 做TCP服务端,把tcp数据按照RTSP协议解析,掉函数直接获取一帧音频,一帧视频这种,分包成RTP发送 用ffmpeg

  9. 6.4hadoop idea本地运行器测试

    1.1  本地运行器进行本地测试 写一个MapReduce驱动程序,执行job,实现tool接口,所以可以通过hadoop的命令行去设置为本地运行模式.实现tool的run函数,在run函数中创建jo ...

  10. js/jQuery中的宽高

    一.和window有关的宽高 window.innerWidth:浏览器窗口宽度 window.innerHeight:浏览器窗口高度(不包括导航,工具栏等的高度) window.outerWidth ...