Jump to content

redirect output


ReDFlaG
 Share

Recommended Posts

hello,

i'm new to this, i've searched thru the forum, read the help file and tryed some coding without any success.

i 'd like to create a shell for a dos tools (mbrwiz). I try to redirect the output of the dos prog to a graphical box but all i can have is the error code...

$val = RunWait(".\mbrwiz.exe /list", "", @SW_HIDE)

MsgBox(0, "Output:", $val & "!!")

Can some one help me? thanks.

Link to comment
Share on other sites

maybe this can help

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

$foo = Run(@ComSpec & " /c dir foo.bar", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)

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

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

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

8)

NEWHeader1.png

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...