Run as Different User Shortcut - Create for Specified Program and User

How to Create a Shortcut to Run a Program as a Specified User


   Information
This will show you how to create a Run as different user shortcut that will run a program specified by you as a specified user on the Windows 7 and Vista computer.

The user account that you want to run the program as must be password protected.

   Note
When you use the runas shortcut that you created below, you will be prompted to enter the user's password in a command prompt before the program will run as the specified user.


EXAMPLE: RUNAS command
NOTE: These are all of the different options available for the RUNAS command that you could also use with the command in step 2 below.
RUNAS.jpg
Here's How:


1. Right click on a empty area on desktop, and click on New and Shortcut.

2. Type either command below into the location area, and click on the Next button. (see screenshot below)
NOTE: You would substitute USER-NAME in the command with the actual name of the user account that you want to run the program as.
(To have to enter credentials each time opened)

runas /user:USER-NAME "C:\full\path\of\Program.exe"

For example, if I wanted to run Notepad as the test user, I would type this command below.

runas /user:test "C:\Windows\system32\notepad.exe"

OR

(To remember credentials after entered first time to automatically be entered afterwards)

runas /savecred /user:USER-NAME "C:\full\path\of\Program.exe"

For example, if I wanted to run Notepad as the test user, I would type this command below.

runas /savecred /user:test "C:\Windows\system32\notepad.exe"

Step1.jpg
3. Type in something like Program Name - Run as User for the name, and click on the Finish button. (see screenshot below)
NOTE: You can name this anything you would like though.
Step2.jpg
4. Right click on the new Program Name - Run as User shortcut on the Desktop and click on Properties.

5. Click on the Shortcut tab, then click on the Change Icon button. (see screenshot below)
Step3.jpg
6. Click on OK. (see screenshot below)
Step4.jpg
7. Click on Browse (see screenshot below step 8), navigate to the location of the EXE file (ex: notepad.exe) of the program, select it, and click on Open. (see screenshot below)
Step5.jpg
8. Select the program's icon, and click on OK. (see screenshot below)
Step6.jpg
9. Click on OK. (see screenshot below)
Step7.jpg
10. In Vista and Windows 7, you can now Pin to Taskbar (Windows 7 only) or Pin to Start Menu, add to Quick Launch, assign a keyboard shortcut to it, or move this shortcut to where you like for easy use.

11. In Windows 8, you can Pin to Taskbar on desktop, Pin to Start screen, add to Quick Launch, assign a keyboard shortcut to it, or move this shortcut to where you like for easy use.




That's it,
Shawn










 
Last edited:
#Create a Desktop Shortcut with Windows PowerShell
If(!$ShortcutFileName)
{
$ShortcutFileName = (Get-Item $TargetFile).Basename
}
$ShortcutFile = "$env:Public\Desktop\$ShortcutFileName.lnk"
$WScriptShell = New-Object -ComObject WScript.Shell
$Shortcut = $WScriptShell.CreateShortcut($ShortcutFile)
#Run as different user, saves the password
$a="runas.exe /savecred /user:$RunAsUser ""$TargetFile"""
$Shortcut.TargetPath = "runas.exe"
$Shortcut.Arguments = "/savecred /user:$RunAsUser ""$TargetFile"""
$Shortcut.IconLocation = $TargetFile
$Shortcut.Save()

You can download detail SQL script from how to create a shortcut to run an application as a different user(PowerShell)
 

My Computer

Computer type
PC/Desktop
OS
Windows 10
Thank you for the addition Franktan, and welcome to Seven Forums. :)
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self built custom
OS
64-bit Windows 11 Pro for Workstations
CPU
Intel i7-8700K OC'd to 5 GHz
Motherboard
ASUS ROG Maximus XI Formula Z390
Memory
64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz
Graphics Card(s)
ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Sound Card
Integrated
Monitor(s) Displays
2 x Samsung Odyssey G7 27"
Screen Resolution
2560x1440
Hard Drives
1TB Samsung 990 PRO M.2,
4TB Samsung 990 PRO PRO M.2,
TerraMaster F8 SSD Plus NAS
PSU
Seasonic Prime Titanium 850W
Case
Thermaltake Core P3
Cooling
Corsair Hydro H115i
Keyboard
Logitech wireless K800
Mouse
Logitech MX Master 4
Internet Speed
2 Gb/s Download and 100 Mb/s Upload
Antivirus
Malwarebyte Anti-Malware Premium
Browser
Google Chrome
Other Info
Logitech Z625 speaker system,
Logitech BRIO 4K Pro webcam,
HP Color LaserJet Pro MFP M477fdn,
APC SMART-UPS RT 1000 XL - SURT1000XLI,
Galaxy S23 Plus phone
Back
Top