Jump to content

StdOutRead on existing DOS windows


sotl
 Share

Recommended Posts

Hello,

I've been coming here as a resource for a while and have always found a solution through searching, but since I haven't found the solution for my newest obstacle I ask:

Is is possible to use stdoutread on an existing DOS window which wasn't initially opened by autoit?

My boss wants me to make a script which will monitor 4 DOS windows on our server which are needed for day to day operations. When these programs crash they display an error message inside of them. I want to make the error message trigger an email notification.

I can get the pid with WinGetProcess, but from what I've seen in the searches it seems as though my script has to start the windows initially with a flag of 2 for stdoutread to work. Is there another way around? Is there another command I can use?

Thank you in advance

Offtopic: And I'd like to say that AutoIT rocks. We now can startup and shutdown applications/video projectors on various computers throughout our network at the push of a button from one machine. Thank you AU3 devs. :)

Edited by sotl
Link to comment
Share on other sites

I think you have to resort to some C/C++ to get it right. Try to search for something called stub.exe (stub.zip) by @valik. I have found the source in the forume before. A search like this should also give you several threads discussing the topic.

Happy hunting.

Link to comment
Share on other sites

hmm, just a nother thought. Can't you monitor for the crashed process? Or does it continue to live? Or is it a script?

Link to comment
Share on other sites

I wish the darn thing would crash and disappear.. then it would be soo easy (If winexists(...) = false). But the thing continues living and just changes its text to say error. it has a dos type gui inside of it. Our system uses SMS (Springer Miller Systems) if you are familiar with it. It's really old and DOS based.

edit: btw thanks for the quick responses!

Edited by sotl
Link to comment
Share on other sites

Supose your out of luck then.. :)

Sometimes it is possible to capture the thing with tee, in core utils, from gnuwin32. But then you have to be able to control how the apps are started.

Link to comment
Share on other sites

I'm not that good at this sort of thing, but is it possible to so a edit>mark, then capture all the text on the screen? once you have it in the clipboard, you could then read what is there. Its messy, but it may work. You could have it loop every so often to do this for each DOS window.

I looked around, and I see what you mean on your problem.

Link to comment
Share on other sites

I'm not that good at this sort of thing, but is it possible to so a edit>mark, then capture all the text on the screen? once you have it in the clipboard, you could then read what is there. Its messy, but it may work. You could have it loop every so often to do this for each DOS window.

I looked around, and I see what you mean on your problem.

Dude... you == :)

that might just work.

Link to comment
Share on other sites

  • 2 years later...

Forgot that one. The old ALT+SPACE->E->S->ENTER trick. Nice @volly..:D

Messy, but much better than waiting some specified time before sending your input. This helps me tremendously until someone can come up with something better. Thanks for sharing.

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...