In this post, I will show you how to run a Windows shortcut as administrator without asking for password.
Sometimes, you may need to run a specific application with administrative privileges but want to avoid entering the administrator password each time. Here’s a simple way to do it using the "runas" command.
Creating a New Shortcut
If you want to create a new shortcut that runs a program as an administrator without asking for a password, follow these steps:
- Create the Shortcut:
- Right-click on your desktop and select "New > Shortcut".
- In the location field, paste the following command, replacing the placeholders with your specific details:
runas.exe /user:domain\administrator /savecred "cmd /C """C:\MyApplication_Path\MyApplication.exe"""{codeBox}
- Replace "domain\administrator" with your actual domain and administrator username.
- Update "C:\MyApplication_Path\MyApplication.exe" with the path to the executable file of the application you want to run.
- Name the Shortcut:
- Click "Next" and give your shortcut a name.
- Run the Shortcut:
- When you run the shortcut for the first time, you will be prompted to enter the administrator password.
- The credentials will be saved, so you won’t need to enter the password again in the future.
Editing an Existing Shortcut
If you already have a shortcut and want to modify it to run with administrative privileges without prompting for a password:
- Locate the Shortcut:
- Find the existing shortcut on your desktop or in the Start menu.
- Right-Click and Edit:
- Right-click the shortcut and select "Properties".
- In the Target field, replace the current path with the "runas" command:
runas.exe /user:domain\administrator /savecred "cmd /C """C:\MyApplication_Path\MyApplication.exe"""{codeBox}
- Again, make sure to replace "domain\administrator" with your domain and username, and update the application path.
- Apply and Save:
- Click "Apply" and then "OK" to save the changes.
- First-Time Run:
- When you run the shortcut after editing, enter the administrator password once. Future launches won’t require the password.
Be cautious when using the "/savecred" switch, as it stores the credentials on the machine. Ensure this method is used in a secure environment.{alertWarning}