Sign in to follow this  
Followers 0
Guest Nick Burns

Controlling a Telnet session

3 posts in this topic

Hi! Long time user, first time member. Just upgraded to v3 and love the new features.

I'm trying to control a telnet session. How can I pause (without using sleep()) AutoIT to wait for certain prompts to appear before sending it's commands. I need it to wait for the prompts:

Login: [send login name]

Password: [send password]

and then the systems prompt: (root\#) [ send command]

currently I'm using Sleep() and I've got the script compiled to a RunTel.EXE file. If you run RunTel directly, the sleep delays are perfect.

I'm trying to shell() to RunTel from another app, and I found that RunTel runs slower, you can actually see the letters on the Console window. and the sleep delays are off.

The actual application is a web program and when I run the app from the server, the shell()ed RunTel runs even slower. :D

So, if there was away for AutoIT to wait for certain text to appear in the Console before sending it's commands, I'd appreciate any help in the matter.

Share this post


Link to post
Share on other sites



You could try launching the AutoIt spy window to see if any of the window text from your telnet application is detected. I don't know that much about how telnet works, but if you can log your session to a file, you chould also check that file for the existance of the text you are searching for.


[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Share this post


Link to post
Share on other sites

... if there was away for AutoIT to wait for certain text to appear in the Console before sending it's commands, I'd appreciate any help in the matter.

Which telnet client are you using? With the console mode telnet.exe bundled with Windows XP. the WindowText is always blank. There is a little trick to use autoIt to get the text from the console using the clipboard, and then examine the text in it. You'll have to retry several times with a short sleep() between, rather than a long sleep.

Hope it helps.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0