Command line progress
Posted: Wed Nov 09, 2011 5:29 pm
First let me say that this is a great tool, very flexible.
I wanted to create my own UI based imaging tool to perform some of the custom tasks I require. To do this I used the command line version of USB Image Tool (usbitcmd.exe). My plan is to use a HTA/VBScript program to launch the command line version and then capture the output to update a progress bar.
I've used this method with other command line tools (ImageX) and it works fine. The problem I'm having is that I don't see any of the output from usbitcmd.exe until after it completes imaging. To test this I launched it from a console window and redirected the output to a text file (usbitcmd.exe r 2440 usb.img /i /d > stdout.txt). When I run this, the text file remains empty until after the imaging completes.
Is there any way I can capture the imaging progress while it is running to show the user how much is left?
Thanks,
Rich
I wanted to create my own UI based imaging tool to perform some of the custom tasks I require. To do this I used the command line version of USB Image Tool (usbitcmd.exe). My plan is to use a HTA/VBScript program to launch the command line version and then capture the output to update a progress bar.
Code: Select all
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("usbitcmd.exe r 2440 usb.img /i /d")
Do While oExec.Status = 0
strTempLine = oExec.stdout.readline
if instr(strTempLine, "%") > 0 then
intCurrentProg = cint(mid(strTempLine, instr(strTempLine, "%") - 3, 3))
progressBar.Value = intCurrentProg
end if
Loop
Is there any way I can capture the imaging progress while it is running to show the user how much is left?
Thanks,
Rich