probedrone Posted August 11, 2006 Share Posted August 11, 2006 I need to run a program from the command prompt, and the program will ask the user for inputs. For example: do you want to ... (y/n) do you want to ... (y/n) do you want to turn autoit on (y/n) do you want to ... (y/n) If I want to select yes on the 3rd option and no on the others, how can i grab the text "turn autoit on" from cmd so I can give the right answer. (The number of questions may differ so I cant just send - n, n, y, n) AutoIt Window Info cant seem to detect text off the cmd window Link to comment Share on other sites More sharing options...
BigDod Posted August 11, 2006 Share Posted August 11, 2006 You need to use StdinWrite and StdOutRead, need Beta. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
probedrone Posted August 15, 2006 Author Share Posted August 15, 2006 Ive been looking around at stdoutread() but being an AutoIt newb I dont really understand how it works or how to use it. Any help would be great. Link to comment Share on other sites More sharing options...
MHz Posted August 15, 2006 Share Posted August 15, 2006 A small example of using StdOutRead ; Use additional flag to use StdOut $pid = Run(@ComSpec & ' /c help', '', @SW_HIDE, 2) ; Variable to store StdOut $data = '' While 1 ; Get StdOut $data &= StdOutRead($pid) ; Exit the loop when StdOut is finished If @error Then ExitLoop WEnd ; Show StdOut MsgBox(0, 'CMD Help commands', $data) 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