Jump to content
Sign in to follow this  
dewclaws

shell out and wait but capture the output

Recommended Posts

Should work fine bij doing (untested):

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

$foo = Run(@ComSpec & " /c cscript script.vbs", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)

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
Edited by Jos

Share this post


Link to post
Share on other sites

Thanks for the help. That worked!

Should work fine bij doing (untested):

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

$foo = Run(@ComSpec & " /c cscript script.vbs", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)

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

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  

×
×
  • Create New...