Running a command as an administrator with Runas.exe
Solution 1
If you entered the command as your provided it should prompt you for the password for BruceWayne\Administrator not brucewayne.
I guess I am a little confused about what you are trying to do in your example. If you want to open command prompt as administrator why not right click cmd.exe and select Run as administrator?
runas allows you to run a program as another user. Depending on whether or not Secure Desktop in enabled on the computer this may or may not do what you want it to. If you just want to run a program as administrator you can often right click the program and select Run as administrator. You can use runas to run a program as any other user not just as the administrator. In fact, using runas to run a program as administrator may not work depending on your Secure Desktop and UAC configuration. It is not enough to run the program as the administrator, you also need to get the program to run with elevated privileges. runas is not the proper solution to accomplish that. http://arstechnica.com/civis/viewtopic.php?t=1121817
Let's say though that you are logged into a computer as the user Administrator and you wanted to run Outlook as Bob. You can run the command below to open Outlook as Bob without logging out of Administrator.
runas /user:bob "C:\Program Files\Microsoft Office 15\root\office15\OUTLOOK.EXE"
If you are logged into a computer as the user Administrator and you wanted to run Outlook as the domain user Bob when you are logged into a computer joined to the example.loc domain you would change the command slightly to what is shown below.
runas /user:example\bob "C:\Program Files\Microsoft Office 15\root\office15\OUTLOOK.EXE"
You can find more information about the syntax for run as by entering the below command in command prompt:
runas /?
Solution 2
It does let you enter. However for protection reasons it does not show in the prompt while entering. You just got to type your password and then hit enter and the command will be executed correctly.
Related videos on Youtube
QMord
Updated on September 18, 2022Comments
-
QMord over 1 year
I've read several threads about using the
runas.exe
command to start an elevated process. However, when I type try to use the commandrunas.exe /user:BruceWayne\Administrator cmd.exe
, the Command Prompt opens up asking for my password, but it won't let me enter it.I can press Enter and the Command Prompt will close, but I can't get anywhere beyond this. Does anyone have any ideas as to why this might be happening?
-
techraf over 8 yearsWhat is
BruceWayne
? A machine name, domain name, user name? -
Moab over 8 years@techraf Its in the run command, its a USER..
-
techraf over 8 yearsBut before backslash you should provide either a domain name or a machine name, nor a user name. What exactly are you trying to achieve?
-
QMord over 8 yearsSorry about that, I've tried with both "runas /user:brucewayne\administrator cmd" and "runas /user:brucewayne cmd"
-
techraf over 8 yearsWhat user are you running current command prompt window, what user do you intend to run the new
cmd.exe
? -
QMord over 8 yearsI intend to run the user as the account I'm currently signed into, BruceWayne. I'm curious how to do this with Run.
-
techraf over 8 yearsIf you intend to run a program with credentials of the current user, why do you consider running it through a command designed to execute programs with other accounts' credentials?
-