Telnet batch file

Gromitt

Well-Known Member
Joined
Aug 22, 2006
Messages
159
Reaction score
0
Location
P.E
Hope you guys can help.

I want to create a batch file that will, when run, automatically telnet into a router and make certain changes. The important factor is for the whole process to be automated, so no pauses for user name and password.

Any idea on the syntax?
 
you can feed telnet via a txt file.

so, create a txt file, 123.txt or whatever, then type your commands in there, as if you were in the telnet console, i.e. open 127.0.0.1 etc etc

then start telnet with

telnet <123.txt
and it will read input from the txt file

then make a quick/dirty one line batch with
telnet <123.txt
as the only entry
 
That looks good.

Just to check a few things:

the txt file will contain something similar to the following:

192.168.x.x
username
password
router commands
quit

Then the txt file just routed to telnet let say using the command prompt in windows as telnet < c:/test.txt
 
yes, you sort of go it right
whatever is in the text file gets fed to the telnet command...

the end bit would be telnet <c:\test.txt ...not forwardslash.

try it out command by command so you dont make a fsck up.
 
It seems that Expect scripts are going to be the easiest. I however need the win32 version. All the links on the mentioned site seem to be broken. Anyone else know where I could get a win32 port for Expect?
 
Top
Sign up to the MyBroadband newsletter
X