Aassdd Posted June 23, 2008 Posted June 23, 2008 I have a C program and its source (so I know all the vars names). The program does some things and print text on the dos window. How can I read that text?
Dampe Posted June 23, 2008 Posted June 23, 2008 I was just about to post a topic asking the exact same question Can't seem to find anything on it anywhere
Zedna Posted June 23, 2008 Posted June 23, 2008 (edited) Look at my Net Send GUI wrapperhttp://www.autoitscript.com/forum/index.ph...st&p=343332#include <Constants.au3> $computers = '' $foo = Run(@ComSpec & ' /c net view', @ScriptDir, @SW_HIDE, $STDOUT_CHILD) While 1 $computers &= StdoutRead($foo) If @error Then ExitLoop WEnd ConsoleWrite ($computers & @CRLF)EDIT: added include file Edited June 23, 2008 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
Aassdd Posted June 23, 2008 Author Posted June 23, 2008 (edited) Let's hope we'll get an answer soon because I need it soon EDIT: Thanks! I'll try it. How can this help me? :S Edited June 23, 2008 by Aassdd
Dampe Posted June 23, 2008 Posted June 23, 2008 Look at my Net Send GUI wrapper http://www.autoitscript.com/forum/index.ph...st&p=343332 $computers = '' $foo = Run(@ComSpec & ' /c net view', @ScriptDir, @SW_HIDE, $STDOUT_CHILD) While 1 $computers &= StdoutRead($foo) If @error Then ExitLoop WEnd ConsoleWrite ($computers & @CRLF) Thanks, works perfect
Aassdd Posted June 23, 2008 Author Posted June 23, 2008 I want to read that text and write it to a text file, how does that suppose to help me?
Zedna Posted June 23, 2008 Posted June 23, 2008 I want to read that text and write it to a text file, how does that suppose to help me?Instead of "net view" place "your_dos_application_name.exe" :-) Resources UDF ResourcesEx UDF AutoIt Forum Search
Aassdd Posted June 23, 2008 Author Posted June 23, 2008 (edited) I do but it doesn't print anything in the console $text = "" $wnd = Run("C:\Users\Alter\Desktop\**.exe -parameters..", "", @SW_HIDE) While 1 $text &= StdoutRead($wnd) If @error Then ExitLoop WEnd ConsoleWrite ($text & @CRLF) EDIT: Nvm I got it! You really helped me, thanks a million! Edited June 23, 2008 by Aassdd
weaponx Posted June 23, 2008 Posted June 23, 2008 I do but it doesn't print anything in the console $text = "" $wnd = Run("C:\Users\Alter\Desktop\**.exe -parameters..", "", @SW_HIDE) While 1 $text &= StdoutRead($wnd) If @error Then ExitLoop WEnd ConsoleWrite ($text & @CRLF) What version of AutoIt are you using? There were major changes to StdOutRead() in 3.2.12.1.
Aassdd Posted June 23, 2008 Author Posted June 23, 2008 (edited) I should have used $STDOUT_CHILD #include <Constants.au3> $text = "" $wnd = Run("C:\Users\Alter\Desktop\.., "", @SW_HIDE, $STDOUT_CHILD) While 1 $text &= StdoutRead($wnd) If @error Then ExitLoop WEnd ConsoleWrite ($text & @CRLF) Edited June 23, 2008 by Aassdd
Zedna Posted June 23, 2008 Posted June 23, 2008 $wnd = Run(@ComSpec & ' /c your_app.exe -parametres', "C:\Users\Alter\Desktop\", @SW_HIDE, $STDOUT_CHILD)Look carefully at my previous posts!!! You changed what I posted in Run()For DOS applications you must use @ComSpec & ' /c to be able to catch it's DOS output. Resources UDF ResourcesEx UDF AutoIt Forum Search
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