1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| '*******************************************************************************
'Rebooter le routeur à distance via Telnet afin de renouveler l'adresse IP publique
Option Explicit
Dim MyHote,MyLogin,MyPassword
MyHote = "192.168.1.1"
MyLogin = "MonLogin"
MyPassword = "Monmotdepasse"
Call Reboot_MyRouter(MyHote,MyLogin,MyPassword)
'*******************************************************************************
Sub Reboot_MyRouter(MyHote,MyLogin,MyPassword)
Dim ws,Command,StrCommand,Execution
Set ws = CreateObject("wscript.shell")
Command = "Telnet " & MyHote
StrCommand = "cmd /c color 9B & mode con cols=65 lines=10 & "& Command &""
Execution = ws.run(StrCommand,1,False)
wscript.sleep 500
ws.AppActivate Command
ws.sendkeys MyLogin
ws.sendkeys "{enter}"
wscript.sleep 1000
ws.sendkeys MyPassword
ws.sendkeys "{enter}"
wscript.sleep 1000
ws.sendkeys "Reboot"
ws.sendkeys "{enter}"
End Sub
'******************************************************************************* |
Partager