Jump to content

Recommended Posts

Posted

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!

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!

  • 1 month later...
Posted

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)

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
×
×
  • Create New...