dewclaws Posted May 6, 2008 Posted May 6, 2008 I have a simple VBS that I need to execute and read the output? I did a few minutes of searching and could not find a method of doing this. - Dewclaws Dewclaws
Developers Jos Posted May 6, 2008 Developers Posted May 6, 2008 (edited) 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 May 6, 2008 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
dewclaws Posted May 9, 2008 Author Posted May 9, 2008 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 Dewclaws
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now