Sign in to follow this  
Followers 0
tsjippy

Not all text is returned with StdoutRead

13 posts in this topic

#1 ·  Posted (edited)

I want to show output in a GUI, so I do StdoutRead of the process.(OSCdimg)

Unfortunately, the program does not return the line with "% complete" in it.

And thats exactly what I need.

Does anyone know if its possible to get that data from the stream?

My code is below.

$result = Run(@ComSpec & " /c" & @TempDir & '\oscdimg.exe -b"D:\Windows 8 Pro\boot\etfsboot.com" -h -lWindowsInstallerPro -m -u1 "D:\Windows 8 Pro" "D:\W81"', "",@SW_Show, $stderr_child + $stdout_child)

While ProcessExists($result)
    MsgBox(0,"",StdoutRead($result,True),1)
WEnd
Edited by tsjippy

Share this post


Link to post
Share on other sites



Hello tsjippy!

Welcome to the AutoIt forum! :)

Using code tags will make things a little easier for all of us, which can be done with the edit bottom on the bottom right of your post, or for future knowledge. Very easy, just use [ autoit ] ;code goes here [ /autoit ] (minus the spaces) or the squared triangle button on the toolbar.

Example:

$example = "test" ;; just a test

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites

Thank you, changed it.

Good to know:)

Share this post


Link to post
Share on other sites

My pleasure, my knowledge on this subject is miniscule, so I'm very sure someone with more knowledge will be along soon. ;)


Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

tsjippy,

Try it like this...

local $out

$result = Run(@ComSpec & " /c " & @TempDir & '\oscdimg.exe -b"D:\Windows 8 Pro\boot\etfsboot.com" -h -lWindowsInstallerPro -m -u1 "D:\Windows 8 Pro" "D:\W81"', "",@SW_Show, $stderr_child + $stdout_child)

While 1
    $out &= StdoutRead($result)
    if @error then exitloop
WEnd

msgbox(0,'',$out)

* - repost of deleted post

** - added space per jguinch

***- untested, don't have the WAIK kit installed locally

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

That does not work for me, what I want to show in my GUI how much of the image creation is completed.

Share this post


Link to post
Share on other sites

What text are you getting when you run OSCdimg with this script?


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

OSCDIMG 2.55 CD-ROM and DVD-ROM Premastering Utility
Copyright © Microsoft, 1993-2007. All rights reserved.
Licensed only for producing Microsoft authorized content.


Scanning source tree (2500 files in 750 directories)
Scanning source tree complete (2820 files in 997 directories)

Computing directory information complete

Image file is 8833138688 bytes

Writing 2820 files in 997 directories to D:W81

1% complete

 

I am missing the lowest line

Share this post


Link to post
Share on other sites

or better is probably the example below:

OSCDIMG 2.55 CD-ROM and DVD-ROM Premastering Utility
Copyright © Microsoft, 1993-2007. All rights reserved.
Licensed only for producing Microsoft authorized content.


Scanning source tree (2500 files in 750 directories)
Scanning source tree complete (2820 files in 997 directories)

Computing directory information complete

Image file is 8833138688 bytes

Writing 2820 files in 997 directories to D:W81

1% complete
Process terminated

 

In the ouput stream I have the following:

OSCDIMG 2.55 CD-ROM and DVD-ROM Premastering Utility
Copyright © Microsoft, 1993-2007. All rights reserved.
Licensed only for producing Microsoft authorized content.


Scanning source tree (2500 files in 750 directories)
Scanning source tree complete (2820 files in 997 directories)

Computing directory information complete

Image file is 8833138688 bytes

Writing 2820 files in 997 directories to D:W81


Process terminated

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

I suspect that the process is ending before the sysout stream closes and you are dropping out of the sysout read loop, hence my suggestion...suspicion only...

Belay that, your output shows that is not the case...

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

No way, I receive the data with StderrRead

I thought that was only for errors, but probably the program treats it as an error then.

Thanks for all your help!

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