General discussion

Locked

Automating Telnet.

By shmaltz ·
I'm trying to write a batch file in windows that will execute commands to a telnet session after I issued the command in the batch file to start Telnen.
So far I have not been able to send any commands to the Telnet session using a Batch file.
If anyone can please help me.

This conversation is currently closed to new comments.

10 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Automating Telnet.

by TimTheToolMan In reply to Automating Telnet.

Hi,

Apparently what you're trying to do isn't trivial. Here's a link to a discussion group on this subject. There's some usefull information for you here.

Being a perl programmer, I'd probably go for that option :-)

http://www.winscriptingsolutions.com/Forums/Thread.cfm?CFID=17220655&CFTOKEN=32824817&CFApp=73&Thread_ID=84035

(remove spaces in the above URL)

Cheers,
Tim.

Collapse -

Automating Telnet.

by shmaltz In reply to Automating Telnet.

Sorry, but the URL doesn't work (even after removing spaces). You are a perl programmer good for you, who said I'm not. In my question I stated: a batch file in windows. Got it I know I can program it I have done it before. What I'm looking for issomething thats going to work on any windows (by any I mean, any windows mahcine that has by default telnet isntalled, Win9x WINNT WIN2000) machine without installing additional software. So, at the end it does make me think it is trivial.

Collapse -

Automating Telnet.

by TimTheToolMan In reply to Automating Telnet.

Actually I said it ISNT trivial.

There is NO easy way to make a telnet session in, and then continue to read from a batch file. Thats what the thread was about.

You need to remove the space from the URL as per my comment below it. I tried it and it works fine.

Also, you can write a batch file that contains embedded perl script that calls itself with the "-x" option on the perl line.

...but being a competent perl programmer, I guess you knew that.

Good luck,
Tim.

Collapse -

Automating Telnet.

by TimTheToolMan In reply to Automating Telnet.

Ah... on reading your comment again, I notice you're NOT a perl programmer... no matter... one of the answers in the thread describes the perl you'd use. I'm sure you could fix it to do what you wanted.

I wouldn't have mentioned perl if it hadn'tbeen one of the options offered in the thread.

Persist with the URL - that is if you want a resolution to your problem...

Collapse -

Automating Telnet.

by TimTheToolMan In reply to Automating Telnet.

One last comment.... You mentioned you'd done it before.

Are you sure you're not thinking of scripting FTP? Thats certainly possible. Theres a script reading option off the command line.

Not so with telnet.

The only other possibility I can think of in the limited world of DOS is...

telnet < script.txt

but it doesn't work. I tried it for you.

By the way, I'm trying to help you so the least you could do is be polite!

Collapse -

Automating Telnet.

by shmaltz In reply to Automating Telnet.

I know you are trying to help me. But you are not actualy helping me. I asked, and I repeated it in the comments, I'm looking for a solution for Windows without any additional programs installed on the computers. I am a Perl programmer, I have programmed this in perl, What I'm looking for is to do a batch file that will do it for me. Perl is not going to work on a computer unless you have the engine installed on that computer.
I'm sorry but the link does not work.

Collapse -

Automating Telnet.

by shmaltz In reply to Automating Telnet.

I said I have done it before. I have done it in Perl scripting not in windows batch. Now I'm trying to do it Windows Batch.

Collapse -

Automating Telnet.

by TimTheToolMan In reply to Automating Telnet.

Again... I only mentioned perl as its ONE of the options given in the thread. Your original question didn't mention anything about the need to run on "any old windows machine with no extra software"...

I didn't think I'd signed up for this site in the past, but I guess its possible - and I had the cookie needed for access...

Try going to the homepage...

http://www.winscriptingsolutions.com

Then you may or may not need to sign up...
Then do a search (in the search box) for

telnetscript

Its the first thread returned titled "automate telnet?"

There are other solutions given in the thread apart from perl. But there is no straight DOS one. From memory there is suggestion of a windows scripting host one, though (although it has limitations) but that may do what you want.

Take a read anyways. You may change your mind about how you attempt to tackle the problem.

As I said, I dont believe there is a pure DOS based solution to this and neither does anyone in the above forum.

If you come up with one, then I'd certainly like to see it!

Hope you get it in the end...
Tim.

Collapse -

Automating Telnet.

by shmaltz In reply to Automating Telnet.

Thanks for your input. Doing the search did help. Here is the link that came up on my computer (I didn't have to sign up):
http://www.winscriptingsolutions.com/Forums/Thread.cfm?CFApp=73&Thread_ID=84035
From that I see that they don't know of any way to do it with a batch file in Windows. So the only option will be scripting, which is something I wanted to avoid.
Thanks again.

Collapse -

Automating Telnet.

by shmaltz In reply to Automating Telnet.

This question was closed by the author

Back to Windows Forum
10 total posts (Page 1 of 1)  

Related Discussions

Related Forums