Tuesday, 26 June 2018

Enable Standard Users to Run a Program with Admin Rights without the Password

To let standard users run a program with administrator rights, we are going to use the built-in Runas command. To start, you need to know two things before you can do anything. The first one is the  computer name, and the second one is the username of your administrator account.
If you don’t know the  computer name, press “Win + X,” and then select the “System” option. If you are using Windows 7, you can search for it in the Start menu.
win-run-as-admin-select-system
The above action will open the System window. Here you will find your computer name listed.
win-run-as-admin-computer-name
You can find your administrator username in the User Accounts window.
Once you have the details, you can create the shortcut. To do that, right-click on your desktop and then select the “New” option and then “Create Shortcut.”
win-run-as-admin-new-shortcut
The above action will open the “Create Shortcut” window. Click on the “Browse” button, and select the application you want users to  run with admin rights.
win-run-as-admin-create-shortcut-window
In my case I’m selecting a simple application called Speccy. Though this app only shows the system information and temperatures, it requires admin privileges to work.
After selecting the application, this is how the Create Shortcut window looks.
win-run-as-admin-add-program
Enter the following command at the beginning of the file path. Don’t forget to replace ComputerName and Username with the actual details.
The completed command looks something like this.
win-run-as-admin-add-command
Once you are done, click on the “Next” button to continue.
Enter the name of the shortcut and click on the “Finish” button.
win-run-as-admin-name-shortcut
That’s it. You’ve created a custom shortcut for your program. By default, the shortcut you’ve created will have no proper icon.
win-run-as-admin-shortcut-created
However, you can change the icon by clicking on the “Change Icon” button  from the Properties window. You can access the Properties window by right-clicking on the shortcut and then selecting the option “Properties.”
win-run-as-admin-change-icon
Once you are done changing the icon, double-click on it. For the first time, you need to enter the administrator password. So, enter the admin password and press the Enter button.
win-run-as-admin-launch-program
After the first time, whenever a user launches the application using the shortcut you just created, it will be launched with admin rights. The savecred option in the above command will save the admin password so that users can run the application as an admin without actually entering the password.
In fact, if you open the Windows Credentials Manager and navigate to “Windows Credentials,” you will see the saved password.
win-run-as-admin-credential-manager
If you ever want to restrict the user from running the target app as an administrator, simply delete the shortcut or remove the saved credential from the Windows Credential Manager.
Do comment below sharing your thoughts and experiences about using the above method to let standard users run an application with admin rights.

No comments:

Post a Comment