Copy from Txt file to Telnet Session cmd prompt

G

Guest

I would like to be able to copy some of the following commands through a telnet session to a Cisco content switch.
I am finding that when you copy from a text file and then paste into the windows command line, it fails because the return character is not properly recognized.

This is a brief example of what I would like to automate (have available to copy from a text file and paste into a telnet session)

config termina
service service_on
suspen
service service_tw
suspen
service downtime_pag
activ
exi
write memor
show service summar

I need to do this from a text file because XML is not turned on on the switch side. Perhaps there is a special control character that can be utilized within the text file that will force windows command prompt to interpret it as a NEW LINE...

Any ideas? Please...
Thanks
Mike
 
D

David Wang [Msft]

Sounds like an issue with your telnet client mis-interpreting characters.
Have you tried pasting text that only has '\n' instead of '\r\n' ?

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
I would like to be able to copy some of the following commands through a
telnet session to a Cisco content switch.
I am finding that when you copy from a text file and then paste into the
windows command line, it fails because the return character is not properly
recognized.

This is a brief example of what I would like to automate (have available to
copy from a text file and paste into a telnet session):

config terminal
service service_one
suspend
service service_two
suspend
service downtime_page
active
exit
write memory
show service summary

I need to do this from a text file because XML is not turned on on the
switch side. Perhaps there is a special control character that can be
utilized within the text file that will force windows command prompt to
interpret it as a NEW LINE...

Any ideas? Please....
Thanks,
Mike
 
G

Guest

David,
Thanks for the reply. I am not sure I completely understand though. I need to issue these series of commands.. so I tried copying and then pasting the entirity listed below "as is".

config terminal
service service_one
suspend
service service_two
suspend
service downtime_page
active
exit
write memory
show service summary

I am not sure what "\n" or "\rn" signify but I tried adding these to the end of one of the commands below in notepad and then pasting it into my telnet session.

For example... I copied "config terminal \rn" and also tried "config terminal \n" but it does not work. It pastes exactly the same thing as listed in these two examples and DOES NOT go to a new line.

Please let me know if I have misinterpretted you somewhere. Thanks...Mike
 
D

David Wang [Msft]

I do not know what telnet client you are using. I'm using the commandline
telnet client from Windows, and copy/paste of multiple commands from notepad
just works.

As for "\n" -- I'm just noting that each newline inside of notepad actually
has a "\r\n" hidden inside the file content that denotes the existence of
the newline. Depending on telnet client capabilities, it may not like
"\r\n" and want a "\n" instead -- this is usually the responsibility of the
telnet client to do the appropriate translation depending on the emulation
you configure.

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
David,
Thanks for the reply. I am not sure I completely understand though. I need
to issue these series of commands.. so I tried copying and then pasting the
entirity listed below "as is".

config terminal
service service_one
suspend
service service_two
suspend
service downtime_page
active
exit
write memory
show service summary

I am not sure what "\n" or "\rn" signify but I tried adding these to the
end of one of the commands below in notepad and then pasting it into my
telnet session.

For example... I copied "config terminal \rn" and also tried "config
terminal \n" but it does not work. It pastes exactly the same thing as
listed in these two examples and DOES NOT go to a new line.

Please let me know if I have misinterpretted you somewhere. Thanks...Mike
 
G

Guest

thanks David... I will have to play around. I am using command prompt that comes with XP Pro. I think the problem is that I am telneting into a Cisco Content Switch... not actually a Unix / NT box..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top