MiserableLife Posted December 20, 2009 Posted December 20, 2009 (edited) Hello everyone,I've been trying to learn how to read console app with StdoutRead,but i don't know why i cannot get what it gives while the app is running....I've been testing my code with 7z(console),but i still couldn't find out what's wrong...here's my code:#include <Constants.au3> $app = Run(@ComSpec & " /c " & '7z b', @ScriptDir, @SW_HIDE,$STDIO_INHERIT_PARENT) While ProcessExists($app) sleep(100) WEndwithout cmd:#include <Constants.au3> $app = Run("7z b ", @ScriptDir,@SW_HIDE,$STDOUT_CHILD) While 1 ConsoleWrite(StdoutRead($app)) If @error Then Exit WEnd Edited December 20, 2009 by MiserableLife
enaiman Posted December 20, 2009 Posted December 20, 2009 tut-tut-tut ... #include <Constants.au3> $app = Run(@ComSpec & " /c " & 'ping 127.0.0.1', @ScriptDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) While 1 $output = StdoutRead($app) If @error Then ConsoleWrite($output) ExitLoop Else ConsoleWrite($output) EndIf WEnd SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :)
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