bobbintb Posted October 5, 2009 Posted October 5, 2009 this is my code so far: #include <Constants.au3> #include <file.au3> #Include <string.au3> #include <array.au3> Local $foo = Run(@ComSpec & " /c ipconfig/all", @SystemDir, @SW_HIDE, $STDOUT_CHILD) While 1 $line = StdoutRead($foo) If @error Then ExitLoop $line=_StringExplode($line, @CRLF) _ArrayDisplay($line) Wend this is so simple its killing me. i just want to get the output into an array to use for later. i cant seem to get the array to save outside the loop without it being empty. and the array is blank the first time which i dont want either. any ideas?
TurionAltec Posted October 5, 2009 Posted October 5, 2009 #include <Constants.au3> #include <file.au3> #Include <string.au3> #include <array.au3> Local $pid = Run("ipconfig /all", @SystemDir, @SW_HIDE, $STDOUT_CHILD) ;ipconfig not internal to cmd, no need for @comspec ProcessWaitClose($pid) ;Easier than a stupid loop. Just wait for it to finish! $output=StdoutRead($pid) ConsoleWrite($output) $array=StringSplit($output,@CRLF,1) _ArrayDisplay($array)
bobbintb Posted October 5, 2009 Author Posted October 5, 2009 #include <Constants.au3> #include <file.au3> #Include <string.au3> #include <array.au3> Local $pid = Run("ipconfig /all", @SystemDir, @SW_HIDE, $STDOUT_CHILD) ;ipconfig not internal to cmd, no need for @comspec ProcessWaitClose($pid) ;Easier than a stupid loop. Just wait for it to finish! $output=StdoutRead($pid) ConsoleWrite($output) $array=StringSplit($output,@CRLF,1) _ArrayDisplay($array) thank you. i tried taking it out of a loop but i guess my brain just isnt working today.
TurionAltec Posted October 5, 2009 Posted October 5, 2009 I blame the Stdoutread example in the help file.
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