tsjippy Posted January 2, 2015 Posted January 2, 2015 (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 January 2, 2015 by tsjippy
MikahS Posted January 2, 2015 Posted January 2, 2015 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 ~ getENVvarsMy 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
MikahS Posted January 2, 2015 Posted January 2, 2015 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 ~ getENVvarsMy 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
jguinch Posted January 2, 2015 Posted January 2, 2015 (edited) ... and add a space after /c Edited January 2, 2015 by jguinch Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
kylomas Posted January 2, 2015 Posted January 2, 2015 (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 January 2, 2015 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
tsjippy Posted January 2, 2015 Author Posted January 2, 2015 That does not work for me, what I want to show in my GUI how much of the image creation is completed.
BrewManNH Posted January 2, 2015 Posted January 2, 2015 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 GudeHow 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
tsjippy Posted January 2, 2015 Author Posted January 2, 2015 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
tsjippy Posted January 2, 2015 Author Posted January 2, 2015 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
kylomas Posted January 2, 2015 Posted January 2, 2015 (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 January 2, 2015 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
Solution jguinch Posted January 2, 2015 Solution Posted January 2, 2015 (edited) Also, you can try with StderrRead ? Edited January 2, 2015 by jguinch Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
tsjippy Posted January 3, 2015 Author Posted January 3, 2015 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!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now