Sign in to follow this  
Followers 0
apparle

Want to display command prompt output

4 posts in this topic

I want to call a commad and show the live output in a textbox or something else. Can anything be done

Share this post


Link to post
Share on other sites



Lookup StdoutRead in the help file.



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

I want to call a commad and show the live output in a textbox or something else. Can anything be done

Example:

#include <Constants.au3>

Dim $ReadOut

$cmd = Run(@ComSpec & " /c dir c: /b", "", @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD)

While 1
    $ReadOut &= StdoutRead($cmd)
    If @error Then ExitLoop
Wend

MsgBox(0, "StdOut", $ReadOut)
:)

Share this post


Link to post
Share on other sites

Example:

#include <Constants.au3>

Dim $ReadOut

$cmd = Run(@ComSpec & " /c dir c: /b", "", @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD)

While 1
    $ReadOut &= StdoutRead($cmd)
    If @error Then ExitLoop
Wend

MsgBox(0, "StdOut", $ReadOut)
:)

One thing to note, adding redirections will change your STDERR if you're trying to trap it. It's kind of mind numbing to combine command line level logic with autoit STDERR logic.


---"Educate the Mind, Make Savage the Body" -Mao Tse Tung

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