Operating System - Microsoft
1752590 Members
3836 Online
108788 Solutions
New Discussion юеВ

Re: batch file to open telnet, connect to an ip and enter the login and password automatically.

 
santosh_15
New Member

batch file to open telnet, connect to an ip and enter the login and password automatically.

Dear Sir,

I am trying to create a batch file for logon to telnet.
But it doesn't accept username & password. I send you detail please see below:

#############################
1sthotelsonline.bat
-----------------------

telnet www.1sthotelsonline.com
xyz
xxx

############################

This may seem like a simple question but I have never used this application before and am finding it difficult to get started.
please suggest me to how i would go about coding a batch file to open telnet, connect to an ip and enter the login and password Automatically.

regards

santosh
4 REPLIES 4
Antoniov.
Honored Contributor

Re: batch file to open telnet, connect to an ip and enter the login and password automatically.

Hi Santosh,
using file.bat and standard telnet you cannot open session giving user and password.
In your example, telnet start and next new line (xyz and xxx) are read after telnet is closed as command.
You can't work neither in this way:
edit myfile.txt
xyz
xxx
---------------
telnet www.1sthotelsonline.com < myfile.txt
===============
In my example, telnet may accept login (perhaps) but when myfile.txt is ended, sessione close.
To open automatically a telnet session you have use a VT emulator with script capability as PowerTerm (yue can find at ww.ericom.com).

Bye
Antoniov

Antonio Maria Vigliotti
Kim Torkelson
Respected Contributor

Re: batch file to open telnet, connect to an ip and enter the login and password automatically.

I use Telnet occassionally, and don't know of a way to get it to log you in automatically. But you can get it to open the connection "automatically" by typing the IP address at the end of the command line box in the Telnet Properties. Then when you double-click the Telnet icon, it'll be ready for you to login.

Hope this helps. Good Luck.

~kim
Norman_21
Honored Contributor

Re: batch file to open telnet, connect to an ip and enter the login and password automatically.

Hello,

Are you trying to telnet to a UNIX box? Please be more specific. There are some emulation software that you can use and associate with an automated logon script.
Here is an example.
Inside the *.cs file are commands which are recognized by Tiny Term emulation software!
You can not run it from the command line. Let me tell you why, because telnet transfer the password in a plain text and therefore it is strongly recommended to use ssh as a secure shell that encrypts the password.
Hope this help
"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
Ratzie
Super Advisor

Re: batch file to open telnet, connect to an ip and enter the login and password automatically.

I use expect to telnet/ssh into boxes with username and passwd. Works great! I can then ftp files and or change files.