【发布时间】:2013-05-08 14:05:00
【问题描述】:
我正在编写一个脚本来以不同的用户身份运行 IE。在开始脚本显示输入,我想使用输入值作为用户名。
Option explicit
Dim Input, europe
Input = InputBox("Please type mailbox name")
europe = "EUROPE\" & Input
Dim oShell
set oShell= Wscript.CreateObject("WScript.Shell")
oShell.Run "RunAs /profile /user:" & europe & "C:\Program Files\Internet Explorer\iexplore.exe"
WScript.Sleep 100
oShell.Sendkeys Input
oShell.Sendkeys "{ENTER}"
Wscript.Quit
如您所见,用户名在域EUROPE\ 上,密码与用户名相同。
所以用户名应该像这样EUROPE\ & Input,密码应该是& Input
我无法从变量中获取字符串并将其传递给 shell 命令。
【问题讨论】: