【发布时间】:2017-04-04 11:18:30
【问题描述】:
我正在尝试以用户“blain”的身份运行 notepad.exe。因此,我想在命令提示符下使用命令runas /u:blain notepad.exe,它按预期工作并提示输入用户密码。我想自动化它,所以,假设 blain 的密码是“pass”,我输入echo pass| runas /u:blain notepad.exe。
无论我用什么替换 pass,命令总是返回:
C:\Users\blain>echo pass| runas /u:blain notepad.exe
Enter the password for blain:
Attempting to start notepad.exe as user "BLAINE-WIN-10\blain" ...
RUNAS ERROR: Unable to run - notepad.exe
1326: The user name or password is incorrect.
需要注意的一个有趣的事情是,该消息会在按下 Enter 后立即出现。如果我手动输入了错误的密码,大约需要 2 秒才能告诉我密码错误(给出相同的错误消息)。
【问题讨论】: