Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excute Commands in Telnet Sessions

Status
Not open for further replies.

netwalker1

Programmer
Feb 5, 2000
1,241
0
0
EG
I want to make a DOS Script , to add or remove some commands from some devices ..
So I want to create a script to :
1- Telnet on devices
2- send username , and password to the telnet session ..
3- Add some commands
4- Exit ..

How can I do this ?
Note that when I use a .bat file to telnet , it doens't move to the second command.



Mohamed Farid
Know Me No Pain , No Me Know Pain !!!
 
If the "devices" are Windows-based, in your originating .bat file use the "CALL" command to execute a second command and return to the original without exiting.
 
I want to send some commands to the opened Telnet session !
So that after I telnet , I wanted to send my username and my password for example !


Mohamed Farid
Know Me No Pain , No Me Know Pain !!!
 
But I beleive that there is a solution from telnet dos command shell ...

Any advise ?

Mohamed Farid
Know Me No Pain , No Me Know Pain !!!
 
I honestly believe that the username and password cannot be passed with the Windows client. If:

command /c second batch file

-or- Call second batch file

-or- depending on OS version:

Start "" second batch file

does not resolve the issue, you need a Third-Party scriptable telnet client.
 
You can use .bat or .cmd files with the Windows telnet client, albeit is is ugly.

What you cannot do is original poster request #2, which is to pass credentials.

But that inconsequential quibble aside, the fundamental gist of what mhkwood posted is absolutely true, you would be best off using a Third-Party client with full scripting support.
 
Ok ,,
I want to teslnet on a SMTP server , and send an email ..

can you help me to select the 3rd pary client , and to write the script to do such operation ?!

Mohamed Farid
Know Me No Pain , No Me Know Pain !!!
 
Thank you. This solutions have solved one of my problem.

Have Great 'n' Wonderful Day ...

Thanks & Regards,
Sankar.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top