Sign in to follow this  
Followers 0
mid7eleven

Read CMD prompt, if same line restart the program

4 posts in this topic

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?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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


When you're dead, you don't know you're dead - it's only difficult for those that know you. It's the same way when you're stupid...

My Scripts: SCCM UDFInclude Source with Compiled Script, Windows Firewall UDF

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