dinodod Posted July 31, 2007 Share Posted July 31, 2007 Is there any way to capture the output of a DOS command without using a file? For instance, I want to capture the output of the command SET in DOS. It shows me several pieces of information that I might want to use but so far, it seems I have to output the information to a file then parse the file.thx Digital Chaos - Life as we know it today.I'm a Think Tank. Problem is, my tank is empty.The Quieter you are, the more you can HearWhich would you choose - Peace without Freedom or Freedom without Peace?Digital Chaos Macgyver ToolkitCompletely Dynamic MenuSQLIte controlsAD FunctionsEXCEL UDFPC / Software Inventory UDFPC / Software Inventory 2GaFrost's Admin Toolkit - My main competitor :)Virtual SystemsVMWAREMicrosoft Virtual PC 2007 Link to comment Share on other sites More sharing options...
FuryCell Posted July 31, 2007 Share Posted July 31, 2007 Take a look at StdoutRead and related functions in the help file. They should provide the functionality you are looking for. HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
FuryCell Posted July 31, 2007 Share Posted July 31, 2007 (edited) Here is a quick example I modded from the helpfile. [#include <Constants.au3> $foo = Run(@ComSpec & " /c Set homepath", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) While 1 $line = StdoutRead($foo) If @error Then ExitLoop MsgBox(0, "STDOUT read:", $line) Wend P.S. maybe EnvSet and EnvGet will do what you want as well. Edited July 31, 2007 by P5ych0Gigabyte HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
dinodod Posted July 31, 2007 Author Share Posted July 31, 2007 SWEET!!!!! Thanks a billion! This is just what I need! This little function will have such an impact on how I make my scripts! I can already see several things I will improve now that I don't have to rely on files as much Thanks for pointing me in the right direction! Now maybe I can sleep Digital Chaos - Life as we know it today.I'm a Think Tank. Problem is, my tank is empty.The Quieter you are, the more you can HearWhich would you choose - Peace without Freedom or Freedom without Peace?Digital Chaos Macgyver ToolkitCompletely Dynamic MenuSQLIte controlsAD FunctionsEXCEL UDFPC / Software Inventory UDFPC / Software Inventory 2GaFrost's Admin Toolkit - My main competitor :)Virtual SystemsVMWAREMicrosoft Virtual PC 2007 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