Sign in to follow this  
Followers 0
Sethonator

Control a Telnet Session with AutoIT

2 posts in this topic

Hello,

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...")

ContinueLoop

EndIf

If $charsWaiting Then

$currentRead = StdoutRead($ourProcess)

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

StdinWrite($ourProcess, $UserName & @LF)

EndIf

EndIf

EndIf

WEnd

Exit

______________

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  
Followers 0