Jump to content

Want to display command prompt output


apparle
 Share

Recommended Posts

Lookup StdoutRead in the help file.


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

Link to comment
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)
:)
Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...