19

I'm trying to start visual studio 2010 from command prompt using 'RUNAS' so that I can run it as a different user. I ran the following command:

runas /profile /user:myPCName/SomeUserName "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe"

My problem is that the commandprompt says "Enter the password for myPCName/SomeUserName:" but I cannot enter the password. I just get the error "RUNAS ERROR: Unable to acquire user password"

I googled this for a while and the only answer I found was that I cannot see the password entered, but it is entered anyways, and that I must be typing the wrong password. I'm certain I'm not typing the wrong password.

3 Answers 3

24

Actually, I had the same problem with W7 Enterprise (connected to a domain, switching to a locally defined admin user) without UAC elevation with the command:

runas /user:.\admin cmd.exe

It did prompt me for the password.

It also worked when I changed it explicitly to:

runas /user:%COMPUTERNAME%\admin cmd.exe

2
  • 3
    Also worked if don't specify "domain". runas /user:admin cmd.exe Commented Dec 22, 2015 at 8:29
  • 1
    Had the same issue using .\admin, also works to use localhost\admin. Commented Apr 14, 2020 at 23:22
9

There are so many things your forgot to document:

  • what is your logon provider? Are you attached to a domain?
  • are your running this from a UAC elevated command prompt?
  • what does the real user name look like? Is it a system account?
  • does the user account actually exist on your machine?
  • can you logout and logon as that user from your machine?
  • does that also work when you disconnect from the network?
  • do you actually type this command or is it called from a .bat or script?
  • "cannot enter the password", you can't type it or it doesn't like what you typed?

Serverfault.com is a good place to ask about user authentication.

3
  • Wow, you are right that I need to document all of that. I will document it and then post the question on serverfault.com. Thanks! Commented May 18, 2010 at 20:03
  • 11
    I am SO stupid! While I was doing the testing you recommended, I noticed that my syntax was incorrect. I used a "/" in the username instead of a "\" between the domain and username. Commented May 18, 2010 at 21:10
  • John's tip solved this for me. So easy to use the wrong slash since the command's flags use /, while the domain\user specification needs \. Thanks. Commented Sep 30, 2016 at 12:45
7

I just had this issue.

runas /username:domain/user cmd failed

but

runas /username:domain\user cmd worked.

So give your slashes a check.

Not the answer you're looking for? Browse other questions tagged or ask your own question.