visual-studio Runas 错误:无法获取密码
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2859271/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Runas Error: Unable to Acquire Password
提问by John Fischer
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”从命令提示符启动 Visual Studio 2010,以便我可以以不同的用户身份运行它。我运行了以下命令:
runas /profile /user:myPCName/SomeUserName "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe"
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"
我的问题是命令提示符显示“输入 myPCName/SomeUserName 的密码:”但我无法输入密码。我刚刚收到错误“RUNAS 错误:无法获取用户密码”
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.
我用谷歌搜索了一段时间,我找到的唯一答案是我看不到输入的密码,但无论如何都输入了,而且我必须输入错误的密码。我确定我没有输入错误的密码。
采纳答案by Hans Passant
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 yourmachine?
- 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?
- 您的登录提供程序是什么?您是否已附加到域?
- 您是从 UAC 提升的命令提示符运行它吗?
- 真正的用户名是什么样的?是系统账号吗?
- 用户帐户是否真的存在于您的机器上?
- 您可以从您的机器注销并以该用户身份登录吗?
- 当您断开网络连接时,这也有效吗?
- 你真的输入这个命令还是从 .bat 或脚本调用它?
- “无法输入密码”,您无法输入或它不喜欢您输入的内容?
Serverfault.com is a good place to ask about user authentication.
Serverfault.com 是询问用户身份验证的好地方。
回答by Eelco L.
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:
实际上,我在没有 UAC 提升的情况下使用 W7 Enterprise(连接到域,切换到本地定义的管理员用户)遇到了同样的问题:
runas /user:.\admin cmd.exe
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
runas /user:%COMPUTERNAME%\admin cmd.exe
回答by Douganater
I just had this issue.
我刚刚有这个问题。
runas /username:domain/user cmdfailed
runas /username:domain/user cmd失败的
but
但
runas /username:domain\user cmdworked.
runas /username:domain\user cmd工作。
So give your slashes a check.
所以给你的斜线检查。

