Telnet thro DOS batch file

Hi
I want to access remote machine by telnet command which i want to invoke through DOS batch file
I had written following code as script:

telnet -l <login name> <host ip address>

it connects to the machine of specified ip address, but asks me for the password.
I would like to know how should i give login and password both in one line for telnet thro' script and then run a simple command say :
cd <directory name> on this machine accessed thro' telnet

Please help me out for this
[553 byte] By [charutad] at [2007-11-19 10:49:26]
# 1 Re: Telnet thro DOS batch file
It all depends on what telnet client you're using. The standard Microsoft telnet client doesn't appear to support such an option. Look at plink (by the same people that make putty), it supports commandline login (at least via ssh) and you can run commands one line at a time.

Remember that batch files aren't all that intelligent, so you're going to be limited in how you do certain things...
mmetzger at 2007-11-8 0:21:12 >