利用VBS脚本实现Telnet自动连接

把以下代码保存为*.vbs文件,替换IP、用户名、密码。


Dim objShell 
Set objShell = CreateObject("Wscript.Shell") 
objShell.Run "cmd.exe",1,False 
WScript.Sleep 1000 
objShell.SendKeys "telnet 192.168.1.25" 
WScript.Sleep 1000 
objShell.SendKeys "{ENTER}" 
WScript.Sleep 3000 
objShell.SendKeys "y"
objShell.SendKeys "{ENTER}" 
WScript.Sleep 1000 
objShell.SendKeys "User" 
objShell.SendKeys "{ENTER}" 
WScript.Sleep 1000
objShell.SendKeys "Password" 
objShell.SendKeys "{ENTER}" 


posted @ 2018-03-22 12:40  布里  阅读(3083)  评论(0编辑  收藏  举报