Sign in to follow this  
Followers 0
mikjay

Automating a console window?

3 posts in this topic

Hi all,

I took a pretty comprehensive look through the forums to see if this had been addressed, so I apologize if this has been asked. I am wanting to run several commands from the command line, and run conditional statements based on the outcome and prompt. The window info tool only gives location info and doesn't read any text. Are there any UDFs or integrated functions that help this? Thanks!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Automating console windows is annoyingly hard. Instead look at the run and stdoutread functions.

Edited by monoceres

Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

Tried this not even 5 minutes before I read this post. If you still need help:

#include <Constants.au3>

Global $DOS, $Message

$DOS = Run(@ComSpec & " /c Ping www.google.com", "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)

While ProcessExists($DOS)
    $Message = StdoutRead($DOS, True)
WEnd

MsgBox(0, "Stdout Read:", $Message)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0