hmsSurprise Posted April 18, 2007 Share Posted April 18, 2007 From a dos cmd window typing set <CR> lists a set of system variables. Run returns a pid and ShellExec returns a 1 or 0. Is there a way to capture the output of this command? Thanx, jh (Note to PsaltyDS - I checked the help file and forums but might have missed it. ) Link to comment Share on other sites More sharing options...
tannerli Posted April 18, 2007 Share Posted April 18, 2007 Try somethin like this: $pid=Run(@ComSpec & " /c " & 'set', "", @SW_HIDE) StdoutRead($pid) didn't test that but with these commands you're able to do it. The are described in the Helpfile Link to comment Share on other sites More sharing options...
hmsSurprise Posted April 18, 2007 Author Share Posted April 18, 2007 Try somethin like this: $pid=Run(@ComSpec & " /c " & 'set', "", @SW_HIDE) StdoutRead($pid) didn't test that but with these commands you're able to do it. The are described in the Helpfile Ouch, I knew it would show up there. Tried this out but it didn't work, just flashed. But the good news is that while looking up @comspec I found other macros that had the data I was after. So I die happy... Thanks, jh Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 18, 2007 Share Posted April 18, 2007 (edited) So the answer came to you while reading the help file... imagine that! P.S. The STDOUT read is a good technique to learn anyway. The given example just needs some debug and a loop to catch all the data: $ShellVars = "" $pid = Run(@ComSpec & " /c set", @TempDir, @SW_HIDE, 2) ; 2 = $STDOUT_CHILD While 1 $ShellVars &= StdoutRead($pid) If @error Then ExitLoop WEnd MsgBox(64, "Shell Variables", $ShellVars) Edited April 18, 2007 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
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