Jump to content
Sign in to follow this  

Control a Telnet Session with AutoIT

Recommended Posts



possibly you know my problem, that I want to control a telnet Session with autoit.

My Code is:

#include <GuiConstants.au3>

#include <Constants.au3>

Global $UserName = "*****", $IPAddress = "********"

EnvSet("TELNET_REDIR", "1")

$ourProcess = Run("C:\telnet\telnet.exe "&$IPAddress, "C:\telnet",1, $STDERR_CHILD + $STDOUT_CHILD)

While 1

If $ourProcess Then

$charsWaiting = StdoutRead($ourProcess)

If @error = -1 Then

$ourProcess = 0

MsgBox(0, "App Exited", "Process has exited...")



If $charsWaiting Then

$currentRead = StdoutRead($ourProcess)

If StringInStr($currentRead, "********") <> 0 Then

StdinWrite($ourProcess, $UserName & @LF)







So, my problem is, that if i write "$STDERR_CHILD + $STDOUT_CHILD" in the "Run"-Function, the telnet tries to connects to host, but I can only see a cursor at the left side of the telnet-window.

When I delete "$STDERR_CHILD + $STDOUT_CHILD" then I can see how the telnet connects to host and a login screen.

But I need the "$STDERR_CHILD + $STDOUT_CHILD" to read informations out of the console...

Can anybody help me?

Share this post

Link to post
Share on other sites

Does nobody know, how to automate a telnet session with a unix-maschine?

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.