Jump to content

Read CMD prompt, if same line restart the program


Recommended Posts

Hey guys I have some experience and I realize that I can use the Stdoutread command to read from a cmd prompt. What I have going on here is a exe file outputting into a cmd window. I want to read that window's output but here's the caveat, when it times out it stops outputting lines. Now, what I would like to do is read those lines, and then I could create and if statement based on the output and if it matches within lets say a 1 min variable, close that program and reopen it. Is this possible?

Link to comment
Share on other sites

I'm getting a system.IO.exception every time I try to run the program if I simply run the program without $STDERR_CHILD + $STDOUT_CHILD it will run just fine, which leads me to believe the program is checking something of that nature to prevent it from running something like this to monitor the window.

Link to comment
Share on other sites

  • Moderators

mid7eleven, how about posting your code so we can see what you're seeing? Otherwise you have us taking wild guesses in the dark...

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...