Sign in to follow this  
Followers 0
Splash

Telnet automation: Modem Config

3 posts in this topic

#1 ·  Posted (edited)

Hi!

I am are trying to send text to a CMD Window and read output.

Look to my code:

#include <Constants.au3>

AutoItSetOption("WinDetectHiddenText", 1)
$cmd = Run(@ComSpec & " /k telnet 10.1.1.1", @WindowsDir, @SW_HIDE, $STDOUT_CHILD)
Sleep(2000)
ControlSend("C:\WINDOWS\system32\cmd.exe", "", 0, "teste" & @CRLF, 0)
Sleep(2000)

While 1
    $output = StdoutRead($cmd)
    If @error Then ExitLoop
    ConsoleWrite($output & @CRLF)
    Sleep(800)
Wend

and I tryed this too:

#include <Constants.au3>

AutoItSetOption("WinDetectHiddenText", 1)
$cmd = Run("C:\Windows\system32\telnet.exe", @WindowsDir, @SW_SHOW, $STDIN_CHILD + $STDOUT_CHILD)
Sleep(2000)
StdInWrite($cmd, "open 10.1.1.1" & @CRLF)
Sleep(2000)

While 1
    $output = StdoutRead($cmd)
    If @error Then ExitLoop
    ConsoleWrite($output & @CRLF)
    Sleep(800)
Wend

I can't send the command to CMD... :evil:

Can someone help me?

Sorry any english grammar errors. ;)

Thanks in advance.

Edited by Splash

Automatic Update UDF - IP Address UDF - WinPcap AutoIt _FindDevice()[font="Verdana"][size="2"]AutoIt Spanish/Brasil/World community!!![/size][/font]Use you wanna a dot.tk domain please use my link:

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hello Splash

Firstly have you tried using Run(@ComSpec & ' /k ' & 'telnet' & ' ' & 'open 10.1.1.1', @SystemDir, @SW_SHOW)

Edited by failedtocompile

Share this post


Link to post
Share on other sites

Firstly have you tried using Run(@ComSpec & ' /k ' & 'telnet' & ' ' & 'open 10.1.1.1', @SystemDir, @SW_SHOW)

This don't will work... Run command need $STDOUT_CHILD parameter. ;)


Automatic Update UDF - IP Address UDF - WinPcap AutoIt _FindDevice()[font="Verdana"][size="2"]AutoIt Spanish/Brasil/World community!!![/size][/font]Use you wanna a dot.tk domain please use my link:

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