Script .bat pour redémarrer mon routeur

Fermé
abdo driowya Messages postés 126 Date d'inscription mardi 1 mars 2011 Statut Membre Dernière intervention 24 août 2016 - 18 avril 2016 à 12:22
abdo driowya Messages postés 126 Date d'inscription mardi 1 mars 2011 Statut Membre Dernière intervention 24 août 2016 - 18 avril 2016 à 13:45
Bonjour, j'essaye de créer un fichier .bat qui me permet de redémarrer mon routeur grâce a telnet sans interaction de l'utilisateur!
Normalement pour redémarrer mon routeur via cmd je fais :

je veux automatiser ça via un fichier .bat qui redémarre mon routeur une fois je clique dessus merci d'avance




A voir également:

1 réponse

abdo driowya Messages postés 126 Date d'inscription mardi 1 mars 2011 Statut Membre Dernière intervention 24 août 2016
18 avril 2016 à 13:45
c'est bon j'ai trouver la solution
un fichier .wsf
<job>
<script language="VBScript">
Option Explicit
On Error Resume Next
Dim WshShell
set WshShell=CreateObject("WScript.Shell")
WshShell.run "cmd.exe"
WScript.Sleep 1000
'Step 1 - Telnet to remote IP'
WshShell.SendKeys "telnet 192.168.1.1"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 1000
'Step 2 - Issue Commands with pauses'
WshShell.SendKeys "admin"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 1000
WshShell.SendKeys "admin"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 1000
WshShell.SendKeys "reboot"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 1000
'Step 3 - Exit Command Window
WshShell.SendKeys "exit"
WshShell.SendKeys ("{Enter}")
WScript.Quit
</script>
</job>
0