| Previous topic :: Next topic |
| Author |
Message |
fl0ow
Offline
Joined: 20 Jun 2011 Posts: 1
|
Posted: Mon 20 Jun 2011 - 10:47 Post subject: script bat telnet |
|
|
Bonjour, J'aimerais créer un script bat qui se connecte a un switch par l'intermédiaire de telnet , et qui récupére les informations du show run dans un fichier. J'ai déjà commencé mais autant vous dire que je galére un peu. Un peu d'aide ou de redirection serait la bienvenue. Merci
@set tgateboxip=172.16.18.207 @set tgatepassword=rcs @set tgatecommand1=en @set tgatecommand2=show run ::@set tgatecommand3=cd /app/mfgpro/data/trng/intf/ex/BILLY ::@set tgatecommand4=cp -p *.* /app/mfgpro/data/trng/intf/ex/BILLY/arc @set tgatecommand5=exit
REM --------- CONNEXION ------------------------ @start telnet.exe %tgateboxip% @echo set sh=WScript.CreateObject("WScript.Shell")>>telnet.vbs @echo WScript.Sleep 500>>telnet.vbs @echo sh.SendKeys "%tgatepassword%">>$tgateboxip.vbs @echo WScript.Sleep 500>>telnet.vbs @echo sh.SendKeys "%tgatecommand1%">>telnet.vbs @echo WScript.Sleep 500>>telnet.vbs @echo sh.SendKeys "%tgatepassword%">>telnet.vbs
REM --------- TRAITEMENT ----------------- @echo sh.SendKeys "%tgatecommand2%">>telnet.vbs @echo WScript.Sleep 500>>telnet.vbs
REM --------- EXIT ------------------------ @echo sh.SendKeys "%tgatecommand6%">>telnet.vbs @echo WScript.Sleep 500>>telnet.vbs @cscript //nologo telnet.vbs del telnet.vbs |
|
| Back to top |
|
 |
|
|