Splash Posted January 6, 2010 Share Posted January 6, 2010 (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... Can someone help me? Sorry any english grammar errors. Thanks in advance. Edited January 6, 2010 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: Link to comment Share on other sites More sharing options...
failedtocompile Posted January 6, 2010 Share Posted January 6, 2010 (edited) Hello Splash Firstly have you tried using Run(@ComSpec & ' /k ' & 'telnet' & ' ' & 'open 10.1.1.1', @SystemDir, @SW_SHOW) Edited January 6, 2010 by failedtocompile Link to comment Share on other sites More sharing options...
Splash Posted January 6, 2010 Author Share Posted January 6, 2010 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: Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now