- @echo off
- echo set sh=WScript.CreateObject("WScript.Shell") >telnet_tmp.vbs
- echo WScript.Sleep 300 >>telnet_tmp.vbs
- echo sh.SendKeys "open 你的网络设备telnet登录IP" >>telnet_tmp.vbs
- echo WScript.Sleep 300 >>telnet_tmp.vbs
- echo sh.SendKeys "{ENTER}" >>telnet_tmp.vbs
- echo WScript.Sleep 300 >>telnet_tmp.vbs
- echo sh.SendKeys "你的用户名{ENTER}">>telnet_tmp.vbs
- echo WScript.Sleep 300 >>telnet_tmp.vbs
- echo sh.SendKeys "你的密码{ENTER}">>telnet_tmp.vbs
- echo WScript.Sleep 1000 >>telnet_tmp.vbs
- echo sh.SendKeys "reboot{ENTER}">>telnet_tmp.vbs
- start telnet
- cscript //nologo telnet_tmp.vbs
- del telnet_tmp.vbs
复制代码
更改为你的信息后,保存为任意 .bat运行即可
不足
希望能获取运行时间,根据运行时间决定是否要重启,和脚本循环运行。