自动telnet到目的主机执行指令,替换其中[ ]括符中间的内容为实际内容就可以使用了。
#you should delete Three lines with "#' leading,and run following statement
#cscript telnet.vbs(this file name)
#Base on Windows platform.
set sh=WScript.CreateObject("WScript.Shell")
WScript.Sleep 1000
sh.SendKeys "telnet [hostip] -l [user]"
WScript.Sleep 1000
sh.SendKeys "{ENTER}"
WScript.Sleep 1000
sh.SendKeys "[password]{ENTER}"
WScript.Sleep 1000
sh.SendKeys "[command]{ENTER}"

本文介绍了一种通过VBScript实现自动Telnet登录并执行命令的方法。只需将脚本中的占位符替换为实际的主机IP、用户名、密码及命令即可实现自动化操作。此方法适用于Windows平台。
3万+

被折叠的 条评论
为什么被折叠?



