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.

John Fischer
  • 1,115
  • 3
  • 13
  • 24

3 Answers3

23

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

Jesse
  • 8,605
  • 7
  • 47
  • 57
Eelco L.
  • 714
  • 7
  • 7
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.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • 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! – John Fischer May 18 '10 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. – John Fischer May 18 '10 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. – charlie arehart Sep 30 '16 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.

jkdev
  • 11,360
  • 15
  • 54
  • 77
Douganater
  • 71
  • 1
  • 3