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.
- 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.
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.