Tuesday, December 03, 2024
Uncategorized

How to run a program as a different user using runas

Using runas command to run an exe with a different user. Many times we will need a program to be run as a different login account than the one we used to login to the server. We can achieve that using runas command as shown below.

  1. Open a command prompt and run the following command. This will start the application using the account name you have mentioned in the /user switch
runas /user:UserName "fullpathoftheapplication\application.exe"

For example, to start a Command Prompt using a different user TestUser, use the following.

runas /user:TestUser "C:\Windows\System32\cmd.exe"

As you can see, once the command is executed it asked for the password for the user TestUser. And it now started a new command prompt using the mentioned user.

run a program using runas command
the program is started with a different user mentioned in the /user switch in runas command

Note* To do Run as administrator, you can simple right click on a program and use the Run as administrator option as shown in the below screen.

runas administrator without password

Back To Top
error: Content is protected !!