I was able to set up a batch file to open a telnet session, but I still have to type in my username and password for the session to actually start. Is there any way to set up the batch file to automatically enter my username and password?
In other words, I want to login automatically without typing the username and password everytime. (Like loginng in a router via telnet automatically)
Page 1 of 1
Telnet Bat file Auto login
#2
Posted 10 June 2004 - 11:45 PM
telnet [-a][-e escape char][-f log file][-l user][-t term][host [port]]
-a Attempt automatic logon. Same as -l option except uses
the currently logged on user's name.
-e Escape character to enter telnet client prompt.
-f File name for client side logging
-l Specifies the user name to log in with on the remote system.
Requires that the remote system support the TELNET ENVIRON option.
-t Specifies terminal type.
Supported term types are vt100, vt52, ansi and vtnt only.
host Specifies the hostname or IP address of the remote computer
to connect to.
port Specifies a port number or service name.
Those are the commands for a telnet session - from what it says basically you should be able to use -a or -l to automatically log in - provided the server supports the "TELNET ENVIRON" option - hope this helps
-a Attempt automatic logon. Same as -l option except uses
the currently logged on user's name.
-e Escape character to enter telnet client prompt.
-f File name for client side logging
-l Specifies the user name to log in with on the remote system.
Requires that the remote system support the TELNET ENVIRON option.
-t Specifies terminal type.
Supported term types are vt100, vt52, ansi and vtnt only.
host Specifies the hostname or IP address of the remote computer
to connect to.
port Specifies a port number or service name.
Those are the commands for a telnet session - from what it says basically you should be able to use -a or -l to automatically log in - provided the server supports the "TELNET ENVIRON" option - hope this helps
#3
Posted 11 June 2004 - 05:36 PM
Thanx a lot for your reply!!!!!!!
I tried it several times but couldnot be able to get through. Whether I enter the username/password in the bat file or not, it's same I have to enter the username and password everytime whenever i login.
Can someone give me a sample telnet batch file?
Manual attempt (at command prompt):
C:\>telnet XX.XX.XX.XX [enter]
after pressing enter it ask for the username (The command prompt windows clears and the Username appear at the top left corner of the command prompt windows, it seems to be a new window only with "Username:" text)
Username: XXXXXX
After entering the Username, it ask for password
Password: XXXXXX
After entering the password the router's info homepage is displayed
==========================================
Router
Version: XXXXXXXX
Model: XXXXXXXX
==========================================
=>
--------------------------------------------------
This is my sample session.
Batch file which i used earlier:
@echo off
Start C:\windows\system32\telnet XX.XX.XX.XX
===================================
I also tried the -l and -a option but it doesn't worked.
Can someone guide me in the right direction?
Thanks in advance.
I tried it several times but couldnot be able to get through. Whether I enter the username/password in the bat file or not, it's same I have to enter the username and password everytime whenever i login.
Can someone give me a sample telnet batch file?
Manual attempt (at command prompt):
C:\>telnet XX.XX.XX.XX [enter]
after pressing enter it ask for the username (The command prompt windows clears and the Username appear at the top left corner of the command prompt windows, it seems to be a new window only with "Username:" text)
Username: XXXXXX
After entering the Username, it ask for password
Password: XXXXXX
After entering the password the router's info homepage is displayed
==========================================
Router
Version: XXXXXXXX
Model: XXXXXXXX
==========================================
=>
--------------------------------------------------
This is my sample session.
Batch file which i used earlier:
@echo off
Start C:\windows\system32\telnet XX.XX.XX.XX
===================================
I also tried the -l and -a option but it doesn't worked.
Can someone guide me in the right direction?
Thanks in advance.
#4
Posted 14 June 2004 - 11:08 PM
As far as i can see from the doco that i have read.
There isnt anything that can automate the password section? - Correct me if im wrong people...
Basically, -a will log you will pass your current username...
I.E
telnet www.blahblahblah.com -a
Should pass your username, not a password
Whereas
telnet www.blahblahblah.com -l Admin
Should pass the username "admin" and again no password.
As far as i can see there isnt much in the way of passing a Password.
Sorry i couldnt be of more help.
There isnt anything that can automate the password section? - Correct me if im wrong people...
Basically, -a will log you will pass your current username...
I.E
telnet www.blahblahblah.com -a
Should pass your username, not a password
Whereas
telnet www.blahblahblah.com -l Admin
Should pass the username "admin" and again no password.
As far as i can see there isnt much in the way of passing a Password.
Sorry i couldnt be of more help.
#5
Posted 15 June 2004 - 03:28 AM
you will need a 3th party Telnetclient, that can be scripted
there are some share / freeware available
gr /\/\o\/\/
there are some share / freeware available
gr /\/\o\/\/
#6
Posted 22 September 2011 - 06:58 AM
here you go, copy this text to notepad and save this file to .vbs
Set cloner = CreateObject("WScript.Shell")
cloner.run"cmd"
WScript.Sleep 500
cloner.SendKeys"telnet 0.0.0.0"
cloner.SendKeys("{Enter}")
WScript.Sleep 500
cloner.SendKeys"username here"
cloner.SendKeys("{Enter}")
WScript.Sleep 500
cloner.SendKeys"password here"
cloner.SendKeys("{Enter}")
WScript.Sleep 500
cloner.SendKeys"exit"
cloner.SendKeys("{Enter}")
WScript.Sleep 300
cloner.SendKeys"exit"
cloner.SendKeys("{Enter}")
Set cloner = CreateObject("WScript.Shell")
cloner.run"cmd"
WScript.Sleep 500
cloner.SendKeys"telnet 0.0.0.0"
cloner.SendKeys("{Enter}")
WScript.Sleep 500
cloner.SendKeys"username here"
cloner.SendKeys("{Enter}")
WScript.Sleep 500
cloner.SendKeys"password here"
cloner.SendKeys("{Enter}")
WScript.Sleep 500
cloner.SendKeys"exit"
cloner.SendKeys("{Enter}")
WScript.Sleep 300
cloner.SendKeys"exit"
cloner.SendKeys("{Enter}")
#7
Posted 25 February 2013 - 04:48 AM
arlanne2, on 22 September 2011 - 06:58 AM, said:
here you go, copy this text to notepad and save this file to .vbs
Set cloner = CreateObject("WScript.Shell")
cloner.run"cmd"
WScript.Sleep 500
cloner.SendKeys"telnet 0.0.0.0"
cloner.SendKeys("{Enter}")
WScript.Sleep 500
cloner.SendKeys"username here"
cloner.SendKeys("{Enter}")
WScript.Sleep 500
cloner.SendKeys"password here"
cloner.SendKeys("{Enter}")
WScript.Sleep 500
cloner.SendKeys"exit"
cloner.SendKeys("{Enter}")
WScript.Sleep 300
cloner.SendKeys"exit"
cloner.SendKeys("{Enter}")
Set cloner = CreateObject("WScript.Shell")
cloner.run"cmd"
WScript.Sleep 500
cloner.SendKeys"telnet 0.0.0.0"
cloner.SendKeys("{Enter}")
WScript.Sleep 500
cloner.SendKeys"username here"
cloner.SendKeys("{Enter}")
WScript.Sleep 500
cloner.SendKeys"password here"
cloner.SendKeys("{Enter}")
WScript.Sleep 500
cloner.SendKeys"exit"
cloner.SendKeys("{Enter}")
WScript.Sleep 300
cloner.SendKeys"exit"
cloner.SendKeys("{Enter}")
Thanks for the vbs, was being dozy and trying to use bat :-)
#8
Posted 25 February 2013 - 05:27 PM
You could also use Expect or Empty for interactive scripting.
- ← join home network to small test domain network
- Networks and the Internet
- Packet loss when downloading torrents →
Share this topic:
Page 1 of 1



Help
Back to top









