Attention : Valable pour ITGATE & DREAMBOX
Bonsoir à tous,
Afin de répondre à des besoin personnel j'ai developper deux script.
Ceux-ci permettent de lancer une connexion
TELNET et
FTP avec
auto-login et execution de commandes Windows.
********* PRE-REQUIS ********
- Environnement Windows XP ou supportant les commandes *.vbs.
- Un editeur de texte (notepad, ultraedit).
- Un dezzipeur (Winzip, 7Zip, ...).
- Des connaissance en invites de commandes Windows (Telnet/Ftp).
- 5 minutes pour les customiser!
********** PACKAGE *********
- Le package est fournit au format *.zip
- Le contenu du package est constitué de deux fichiers : ftp.bat et telnet.bat
- Une note explicative est fournie.
********** HOW-TO **********
- Sélectionner le script de votre choix et l'editer.
- Renseignez l'adresse ip de votre Itgatebox, le nom d'utilisateur et le mot de passe de connexion (par défaut : root/tgatebox).
- Pour chaque ligne de commande ajouttez après le signe "=" votre commande.
Exemple :
Dans le script FTP je veux lister les repertoires alors la ligne de commande n°1 ressemblera à celà.
@set tgatecommand1=ls
********* SCRIPT FTP*********
Code:
@rem *******************************************
@rem * Auto-Connexion en FTP sur la iTgate *
@rem * Date : 21/03/2006 *
@rem * Auteur : f4bian *
@rem * Forums : http://www.itgateusers.com *
@rem *******************************************
@rem ////// Editez les elements ci dessous concernant votre materiel
@set tgateboxip=192.168.0.3
@set tgateusername=root
@set tgatepassword=tgatebox
@set tgatecommand1=
@set tgatecommand2=
@set tgatecommand3=
@set tgatecommand4=
@set tgatecommand5=
@rem ///// Ne plus rien modifier en dessous de cette ligne !
@rem ///// Creation du script VBS pour connexion automatique
@echo set sh=WScript.CreateObject("WScript.Shell")>>ftp.vbs
@echo WScript.Sleep 500>>ftp.vbs
@echo sh.SendKeys "%tgateusername%">>ftp.vbs
@echo WScript.Sleep 500>>ftp.vbs
@echo sh.SendKeys "~">>ftp.vbs
@echo WScript.Sleep 500>>ftp.vbs
@echo sh.SendKeys "%tgatepassword%">>ftp.vbs
@echo sh.SendKeys "~">>ftp.vbs
@echo WScript.Sleep 500>>ftp.vbs
@rem ///// Lancement des commandes Telnet
@echo sh.SendKeys "%tgatecommand1%">>ftp.vbs
@echo sh.SendKeys "~">>ftp.vbs
@echo WScript.Sleep 500>>ftp.vbs
@echo sh.SendKeys "%tgatecommand2%">>ftp.vbs
@echo sh.SendKeys "~">>ftp.vbs
@echo WScript.Sleep 500>>ftp.vbs
@echo sh.SendKeys "%tgatecommand3%">>ftp.vbs
@echo sh.SendKeys "~">>ftp.vbs
@echo WScript.Sleep 500>>ftp.vbs
@echo sh.SendKeys "%tgatecommand4%">>ftp.vbs
@echo sh.SendKeys "~">>ftp.vbs
@echo WScript.Sleep 500>>ftp.vbs
@echo sh.SendKeys "%tgatecommand5%">>ftp.vbs
@echo sh.SendKeys "~">>ftp.vbs
@echo WScript.Sleep 500>>ftp.vbs
@rem ///// Lancement de la session FTP sur l'iTgatebox
@start /realtime ftp.exe %tgateboxip%
@cscript //nologo ftp.vbs
@del /q ftp.vbs
******* SCRIPT TELNET *******
Code:
@rem *******************************************
@rem * Auto-Connexion en Telnet sur la iTgate *
@rem * Date : 21/03/2006 *
@rem * Auteur : f4bian *
@rem * Forums : http://www.itgateusers.com *
@rem *******************************************
@rem ////// Editez les elements ci dessous concernant votre materiel
@set tgateboxip=192.168.0.3
@set tgateusername=root
@set tgatepassword=tgatebox
@set tgatecommand1=
@set tgatecommand2=
@set tgatecommand3=
@set tgatecommand4=
@set tgatecommand5=
@rem ///// Ne plus rien modifier en dessous de cette ligne !
@rem ///// Creation du script VBS pour connexion automatique
@echo set sh=WScript.CreateObject("WScript.Shell")>>telnet.vbs
@echo WScript.Sleep 500>>telnet.vbs
@echo sh.SendKeys "%tgateusername%">>telnet.vbs
@echo WScript.Sleep 500>>telnet.vbs
@echo sh.SendKeys "~">>telnet.vbs
@echo WScript.Sleep 500>>telnet.vbs
@echo sh.SendKeys "%tgatepassword%">>telnet.vbs
@echo sh.SendKeys "~">>telnet.vbs
@echo WScript.Sleep 500>>telnet.vbs
@rem ///// Lancement des commandes Telnet
@echo sh.SendKeys "%tgatecommand1%">>telnet.vbs
@echo sh.SendKeys "~">>telnet.vbs
@echo WScript.Sleep 500>>telnet.vbs
@echo sh.SendKeys "%tgatecommand2%">>telnet.vbs
@echo sh.SendKeys "~">>telnet.vbs
@echo WScript.Sleep 500>>telnet.vbs
@echo sh.SendKeys "%tgatecommand3%">>telnet.vbs
@echo sh.SendKeys "~">>telnet.vbs
@echo WScript.Sleep 500>>telnet.vbs
@echo sh.SendKeys "%tgatecommand4%">>telnet.vbs
@echo sh.SendKeys "~">>telnet.vbs
@echo WScript.Sleep 500>>telnet.vbs
@echo sh.SendKeys "%tgatecommand5%">>telnet.vbs
@echo sh.SendKeys "~">>telnet.vbs
@echo WScript.Sleep 500>>telnet.vbs
@rem ///// Lancement de la session Telnet sur l'iTgatebox
@start /realtime telnet.exe %tgateboxip%
@cscript //nologo telnet.vbs
@del /q telnet.vbs
***** POUR CONCLURE *****
J'espere que vous aurez autant de plaisir à l'utiliser que j'en ai eu à le créer
@bientôt !