【发布时间】:2014-03-31 17:43:50
【问题描述】:
我是 VB 脚本的新手。其实我想运行一些应用服务器的telnet命令。
我正在我的客户端 PC(操作系统:- Windows server 2003)上运行该 VB 脚本。脚本运行良好。
现在的问题是,当 telnet 通过 VB 脚本运行时,我对此无能为力
电脑。我希望该脚本在后端运行。即处于静音模式。
以下是我正在使用的 VB 代码。
set oShell = CreateObject("WScript.Shell")
oShell.run"cmd.exe"
WScript.Sleep 500
oShell.SendKeys"telnet x.x.x.x -f roamingsubscriber.txt"
oShell.SendKeys("{Enter}")
WScript.Sleep 1500
oShell.SendKeys"username"
oShell.SendKeys("{Enter}")
WScript.Sleep 500
oShell.SendKeys"password"
oShell.SendKeys("{Enter}")
WScript.Sleep 500
oShell.SendKeys"command"
oShell.SendKeys("{Enter}")
WScript.Sleep 1000
oShell.SendKeys"command"
oShell.SendKeys("{Enter}")
WScript.Sleep 1000
...
【问题讨论】:
标签: vbscript