脚本之家,脚本语言编程技术及教程分享平台!
分类导航

Python|VBS|Ruby|Lua|perl|VBA|Golang|PowerShell|Erlang|autoit|Dos|bat|

服务器之家 - 脚本之家 - VBS - VBS 路由重启脚本

VBS 路由重启脚本

2020-07-26 11:59VBS脚本之家 VBS

用vbs实现路由器的重启,时间上就是利用vbs模拟按键输出。

复制代码 代码如下:


Set sh=WScript.CreateObject("WScript.Shell")
sh.Run "telnet 192.168.1.1"
WScript.Sleep 1000
sh.SendKeys "admin{ENTER}"
WScript.Sleep 1000
sh.SendKeys "admin{ENTER}"
WScript.Sleep 1000
sh.SendKeys "reboot{ENTER}"
WScript.Sleep 1500
Dim strComputer,objWMIService,objProcess,colProcessList
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = 'telnet.exe'")
For Each objProcess in colProcessList
objProcess.Terminate()
next

延伸 · 阅读

精彩推荐