The trick to create a shortcut to run the application under Admin

If you want to allow a user account to launch an application as an administrator without the UAC (User Account Control) or password, you can create a shortcut using the runas / savecred command. This command will save your password.

As needed, you can create a shortcut with admin privileges to allow standard users to run programs that require admin privileges.

In Windows, you can create custom shortcuts for almost any file, folder, or program. In general, shortcuts do not give you any admin rights. But there are situations where you need to allow other users on the system to run programs that require admin privileges.

In these cases, you do not need to provide an admin password. Instead, you can create a custom shortcut with admin privileges to allow a standard user to run the program as admin.

Alternatively, if you don't want to see the UAC prompts, you can completely avoid them by creating shortcuts with admin mode. Following are the simple steps to create a shortcut with admin privileges and have a standard user run the program as administrator.

Note: Before moving on to the next section, find the computer name, username, and password of the admin account. You will need this information in the next steps.

1. Activate the Admin account

By default the Admin account is disabled, so you must enable the Admin account.

To activate the administrator account, follow the steps below:

On the Search Start Menu box, type Command Prompt, then right-click the Command Prompt shortcut and select Run as administrator.

Picture 1 of The trick to create a shortcut to run the application under Admin

Enter the following command in the Command Prompt window to activate the Admin account:

net user administrator / active: yes

Picture 2 of The trick to create a shortcut to run the application under Admin

The Admin account is activated, but the account is not password protected.

To set up an administrator account password, open Control Panel and then select Accounts and Family Safety => User Accounts.

On the User Account window, click Manage another account.

Picture 3 of The trick to create a shortcut to run the application under Admin

Select Administrator account, select Create a password and then proceed to create a password for the Admin account.

Picture 4 of The trick to create a shortcut to run the application under Admin

2. Steps to create shortcut with admin rights

Creating shortcuts with admin privileges for a program allowing a standard user to run it as an admin is easier than you might think. The best thing about the method below is that you don't have to give the admin password and the admin permissions are limited to the program. Just follow the steps as follows.

Step 1. As with any custom shortcut, you can create it directly on the desktop. Just right-click on the desktop and choose New> Shortcut.

Picture 5 of The trick to create a shortcut to run the application under Admin

Step 2. In the blank field, copy and paste the code below. Replace ComputerName with the actual computer name, Username with the actual username, and the illustrated file path with the actual path of the exe file for the target program.

runas / user: ComputerNameUsername / savecred "C: dummypathtofile.exe"

Step 3. Click the Next button.

Step 4. In this window, give the shortcut a name. You can name the shortcut with whatever you want. Then, click the Finish button.

Picture 6 of The trick to create a shortcut to run the application under Admin

Step 5. After creating the shortcut, double click on it. The first time, you will be prompted to enter the admin password. Enter the password and press Enter.

Picture 7 of The trick to create a shortcut to run the application under Admin

Step 6. If the username and password are correct, the shortcut will be executed and the program will be launched as admin.

Picture 8 of The trick to create a shortcut to run the application under Admin

Username and password are saved automatically in Windows Credential Manager. Therefore, other users do not have to enter a password. Instead, Windows will automatically extract the password from Credential Manager and launch the application.

If you no longer need a user to launch the app as an admin, delete the shortcut.

3. Create a shortcut to open the application with admin privileges manually in Task Scheduler

Step 1. Press Win + R keys to open the Run dialog box, type taskchd.msc into Run and click OK to open Task Scheduler.

Step 2. Click Task Scheduler Library to the left of Task Scheduler and click Create Task in the Actions section on the right.

Picture 9 of The trick to create a shortcut to run the application under Admin

Step 3. In the General tab, enter the name (eg "Elevated command prompt") you want for this task and enter the optional description of the task.

Picture 10 of The trick to create a shortcut to run the application under Admin

Note the name of this task. You will need that in step 8 and when you create the shortcut for this task in step 13 below.

Step 4. On the General tab, select the Run with highest privileges box.

Step 5. On the General tab, select Windows 10 in the Configure for drop-down menu.

Step 6. Click the Actions tab and choose New.

Step 7. Type cmd.exe in the Program / script field.

Picture 11 of The trick to create a shortcut to run the application under Admin

This is what is being used to open the shortcut with admin privileges, so it cannot be changed to anything else.

Step 8. Enter the command below in the Add arguments field and click OK.

/ c start "Task Name" "Full path of application file"

Replace Task Name in the above command with the task name (eg "Elevated command prompt") you used in step 3 above.

Replace the Full path of application file in the above command with the actual full path of the application file you want to run as admin.

For example:

/ c start "Elevated command prompt" "% windir% System32cmd.exe"

Picture 12 of The trick to create a shortcut to run the application under Admin

Step 9. Now, you should see this new action listed.

Step 10. Click the Conditions tab, uncheck the box Start the task only if the computer is on AC power and click OK.

Step 11. You should now see this new task listed in the Task Scheduler Library. You can now close Task Scheduler if you want.

Step 12. Right-click or press and hold on the desktop, select New and click Shortcut.

Step 13. Enter the command below in the location field and select Next.

schtasks / run / tn "Task Name"

Replace Task Name in the above command with the task name you used in step 3 above.

For example:

schtasks / run / tn "Elevated command prompt"

Picture 13 of The trick to create a shortcut to run the application under Admin

Step 14. Enter the desired name for this shortcut of the task and click Finish.

Step 15. Right-click or press and hold on the new desktop shortcut and select Properties.

Step 16. Click the Change Icon button in the Shortcut tab.

Step 17. Click OK.

Step 18. Click Browse, navigate to and select the application file (eg "% windir% System32cmd.exe") you want to run as admin, click Open, select the icon you want for the shortcut and click OK.

You can use any icon you want for this shortcut.

Picture 14 of The trick to create a shortcut to run the application under Admin

Step 19. Click OK.

Step 20. You can run at startup, pin to taskbar, Start menu, add to All apps, Quick Launch, assign shortcut or move this shortcut to a place you like for ease of use.

Update 02 October 2020
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile