Sign in to follow this  
Followers 0
mentosan

capture string in real time

3 posts in this topic

Hi there !

Is it possible with AutoIt to have a script which can capture a string from an open cmd (Command Prompt) window? Let's say I'm having a telnet session via cmd and from time to time this message appears with different values "Total=50", "Total=36"...etc .I want to capture all this strings into one text file.

Share this post


Link to post
Share on other sites



Sorry, I think I posted my question in a wrong area. Please, move my topic in the Help section.

Thank you

Share this post


Link to post
Share on other sites

Have a look at at STDoutRead() in the help file

; Demonstrates StdoutRead()
#include <Constants.au3>

Local $foo = Run(@ComSpec & " /c dir foo.bar", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
Local $line
While 1
    $line = StdoutRead($foo)
    If @error Then ExitLoop
    MsgBox(0, "STDOUT read:", $line)
Wend

While 1
    $line = StderrRead($foo)
    If @error Then ExitLoop
    MsgBox(0, "STDERR read:", $line)
Wend

MsgBox(0, "Debug", "Exiting...")

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