Sign in to follow this  
Followers 0
fly

I need help with ConsoleRead

7 posts in this topic

Sadly, there isn't an example script for it in the help file. I have a program that launches a console window. I want to be able to hide the console window and pipe the contents to a status box in my AutoIt program. I assume that I use ConsoleRead to do that.

I searched for 'ConsoleRead' and didn't seem to come up with any working examples of what I want to do.

Thanks for any help.

Share this post


Link to post
Share on other sites



Sadly, there isn't an example script for it in the help file. I have a program that launches a console window. I want to be able to hide the console window and pipe the contents to a status box in my AutoIt program. I assume that I use ConsoleRead to do that.

I searched for 'ConsoleRead' and didn't seem to come up with any working examples of what I want to do.

Thanks for any help.

See the example for StdoutRead that may be what you require.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

That was exactly what I wanted. However, it seems to be chopping off some characters at the beginning. Is that cause I'm filling the buffer? (Its only mabe 30 letters...)

edit: Odd. It is specifically missing the first character almost every time, regarless of the length.

Edited by fly

Share this post


Link to post
Share on other sites

That was exactly what I wanted. However, it seems to be chopping off some characters at the beginning. Is that cause I'm filling the buffer? (Its only mabe 30 letters...)

edit: Odd. It is specifically missing the first character almost every time, regarless of the length.

Could you please post some code to show example of what is happening


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Could you please post some code to show example of what is happening

By using a message box, i was able to see that a LARGE amount of data is coming through from the CMD window. That's the problem. I'm afraid I'll just have to leave the window to pop up. Unless its easily possible to format multiple lines from the command window to appear on one...

Share this post


Link to post
Share on other sites

By using a message box, i was able to see that a LARGE amount of data is coming through from the CMD window. That's the problem. I'm afraid I'll just have to leave the window to pop up. Unless its easily possible to format multiple lines from the command window to appear on one...

You could always use ProcessWaitClose to allow the command window to finish what it is doing before reading it.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Impossible to troubleshoot without example code, but...

StdoutRead "eats" the output characters every time it is called unless the call is a "peek" call, I have to wonder if there is an intended peek to see if output is present that is actually consuming the first output character.


Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

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