Forums ProgMatique Forum Index Forums ProgMatique
Programmation (C/C++, JAVA, PHP, JavaScript, ...) et Informatique (Webmaster, Web)
Retour au site Progmatique

script bat telnet

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Forums ProgMatique Forum Index » Programmation » Langages de script (batch, shell, fichier reg, etc...)
Previous topic :: Next topic  
Author Message
fl0ow


Offline


Joined: 20 Jun 2011
Posts: 1


PostPosted: Mon 20 Jun 2011 - 10:47    Post subject: script bat telnet Reply with quote

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
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Forums ProgMatique Forum Index » Programmation » Langages de script (batch, shell, fichier reg, etc...) All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  

Index | Create a forum | Free support forum | Free forums directory | Report a violation | Conditions générales d'utilisation
Powered by phpBB v2 © 2001, 2005 phpBB Group ¦ Theme: subSilver++