欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

VBS 路由重启脚本

程序员文章站 2022-07-04 20:33:24
复制代码 代码如下:set sh=wscript.createobject("wscript.shell") sh.run "telnet 192.168.1.1" wsc...
复制代码 代码如下:

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