本帖最后由 MLJM 于 2015-5-19 16:04 编辑
可以试下用BAT调用VBS- @echo off
- echo set sh=WScript.CreateObject("WScript.Shell") >%TMP%\telnet_tmp.vbs
- echo WScript.Sleep 300 >>%TMP%\telnet_tmp.vbs
- echo sh.SendKeys "open IP" >>%TMP%\telnet_tmp.vbs
- echo sh.SendKeys "{ENTER}" >>%TMP%\telnet_tmp.vbs
- echo WScript.Sleep 1000 >>%TMP%\telnet_tmp.vbs
- echo WScript.Sleep 1000 >>%TMP%\telnet_tmp.vbs
- echo sh.SendKeys "用户名{ENTER}" >>%TMP%\telnet_tmp.vbs
- echo WScript.Sleep 1000 >>%TMP%\telnet_tmp.vbs
- echo sh.SendKeys "密码{ENTER}">>%TMP%\telnet_tmp.vbs
- echo WScript.Sleep 1000 >>%TMP%\telnet_tmp.vbs
- echo sh.SendKeys "执行命令{ENTER}">>%TMP%\telnet_tmp.vbs
- echo WScript.Sleep 3500 >>%TMP%\telnet_tmp.vbs
- echo sh.SendKeys "{ENTER}">>%TMP%\telnet_tmp.vbs
- echo WScript.Sleep 2000 >>%TMP%\telnet_tmp.vbs
- echo sh.SendKeys "exit{ENTER}">>%TMP%\telnet_tmp.vbs //断开
- echo WScript.Sleep 1000 >>%TMP%\telnet_tmp.vbs
- echo sh.SendKeys "{ENTER}">>%TMP%\telnet_tmp.vbs
- echo WScript.Sleep 1000 >>%TMP%\telnet_tmp.vbs
- echo sh.SendKeys "{ENTER}">>%TMP%\telnet_tmp.vbs
- echo WScript.Sleep 1000 >>%TMP%\telnet_tmp.vbs
- echo sh.SendKeys "{ENTER}">>%TMP%\telnet_tmp.vbs
- echo WScript.Sleep 1000 >>%TMP%\telnet_tmp.vbs
- echo sh.SendKeys "quit{ENTER}">>%TMP%\telnet_tmp.vbs //退出telnet
-
-
- start telnet
- rem batch telnet
-
- cscript %TMP%\telnet_tmp.vbs
- del %TMP%\telnet_tmp.vbs
复制代码
|