请根据实际情况作一些更改, 将此代码保存为 X.vbs 文件- ' 请根据路由器实际界面和实际设置更改以下 5 处有注解的数值或字符串值, 此代码以 TL-WR340G 无线路由器为设计依据.
- PosSysTools = 16 ' 焦点到 "系统工具" 所需按 Tab 键的次数
- PosReboot = 5 ' "系统工具" 展开后, 焦点到 "重启系统" 所需按 Tab 键的次数
- PosRebootBtnShift = 6 ' "重启系统" 展开后, 焦点到 "重启系统" 按钮 所需按 Shift+Tab 键的次数
- Set WshShell = WScript.CreateObject("WScript.Shell")
- WshShell.Run "IEXPLORE.EXE http://192.168.1.1/" ' TP-LINK 的默认登录地址为 192.168.1.1, 此处应该无需更改
- WScript.Sleep 100
- WshShell.AppActivate "连接到 192.168.1.1"
- WScript.Sleep 100
- WshShell.SendKeys "%(u)"
- WScript.Sleep 500
- WshShell.SendKeys "admin" ' 双引号中是用户名, 这里取的是 TP-LINK 的默认设置 admin, 请根据实际情况更改
- WScript.Sleep 500
- WshShell.SendKeys "%(p)"
- WScript.Sleep 500
- WshShell.SendKeys "admin" ' 双引号中是密码, 这里取的是 TP-LINK 的默认设置 admin, 请根据实际情况更改
- WScript.Sleep 500
- WshShell.SendKeys "~"
- WScript.Sleep 500
- WshShell.SendKeys "{ESC}"
- WScript.Sleep 500
- For I = 1 To PosSysTools
- WshShell.SendKeys "{TAB}"
- WScript.Sleep 100
- Next
- WshShell.SendKeys "~"
- WScript.Sleep 100
- For I = 1 To PosReboot
- WshShell.SendKeys "{TAB}"
- WScript.Sleep 100
- Next
- WshShell.SendKeys "~"
- WScript.Sleep 3000
- For I = 1 To PosRebootBtnShift
- WshShell.SendKeys "+({TAB})"
- WScript.Sleep 100
- Next
- WshShell.SendKeys "~"
- WScript.Sleep 200
- WshShell.SendKeys "~"
复制代码
|