CONNEXION TELNET AUTOMATIQUE

djilato Messages postés 22 Statut Membre -  
smed_79 Messages postés 1291 Date d'inscription   Statut Contributeur Dernière intervention   -
Bonjour,
j'ai faire une connexion quotidien
ip: 192.168.2.3
USER : DJILATO
PASSWORD: DJLT
je veut crier un fichier .bat pour connecter avec un double click
merci!
A voir également:

6 réponses

djilato Messages postés 22 Statut Membre 6
 
alors j'trouver se script la connexion pas tribien mis le problem que apre exécution il supprim tout les fichier .bat et .txt ?

@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=username
@set tgatepassword=tpassword
@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
3
kayumba valere
 
ça marche ok mais puis avoir les explications pour chacune des lines svp.

Merci
0
xoooom Messages postés 1047 Statut Membre 134
 
essaye ceci

================
@echo off
ftp
open
192.168.2.3
DJILATO
DJLT
pause

===============
0
djilato Messages postés 22 Statut Membre 6
 
ca marche pas
merci
je veut connexion aotomatique
0
xoooom Messages postés 1047 Statut Membre 134
 
essaye ca alors

fichier transfert.cmd :

ftp.exe -v -i -s:C:\ParametreFTP.txt

fichier parametreFTP.txt :

open 192.168.2.3
DJILATO
DJLT
"tu peut mettre a la suite les commande que tu souhaite faire"
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
xoooom Messages postés 1047 Statut Membre 134
 
a mon avi tu te complique la vie, mais bon s'il marche apré tout.
0
smed_79 Messages postés 1291 Date d'inscription   Statut Contributeur Dernière intervention   844
 
Le client Telnet MS ne le permet pas. Essaie avec un autre client comme Putty.

putty.exe -ssh -2 -P 22 user@adresse_IP -pw password -m commande_telnet.txt
le fichier commande_telnet.txt contient les commandes qu'on veut exécuter après une identification (telnet) réussie, par exemple: ( ls > temp.txt)

PuTTY Link: command-line connection utility
Release 0.53
Usage: plink [options] [user@]host [command]
       ("host" can also be a PuTTY saved session name)
Options:
  -v        show verbose messages
  -load sessname  Load settings from saved session
  -ssh -telnet -rlogin -raw
            force use of a particular protocol (default SSH)
  -P port   connect to specified port
  [b]-l user[/b]   connect with specified username
  -m file   read remote command(s) from file
  -batch    disable all interactive prompts
The following options only apply to SSH connections:
  [b]-pw passw login with specified password[/b]
  -L listen-port:host:port   Forward local port to remote address
  -R listen-port:host:port   Forward remote port to local address
  -X -x     enable / disable X11 forwarding
  -A -a     enable / disable agent forwarding
  -t -T     enable / disable pty allocation
  -1 -2     force use of particular protocol version
  -C        enable compression
  -i key    private key file for authentication

je suis la pour apprendre plus que pour résoudre un probleme !
0