Jump to content

How to display the percentage of the progress bar is connected to the ImageX?


i2i8
 Share

Recommended Posts

I want to use ImageX.exe to image install.Wim extract on my hard disk.

DOS commands is as follows:

Imagex.exe /apply install.wim 1 C: /verify

After complete the extract above, and then run the following command.

@cho off
cd\
C:
cd "Windows\System32"
bcdboot C:\Windows /s C:

I want to unzip's progress like The Example 5.au3 ,Unzip can display the progress of a percentage .Extract the finished, run the following DOS command

@cho off
cd\
C:
cd "Windows\System32"
bcdboot C:\Windows /s C:

The Example 5.au3 is included in Attach Files

New Style Progressbar.rar

imagex.rar

From:

Edited by i2i8
Link to comment
Share on other sites

5#include <ProgresssbarClassic.au3>
#include <GUIConstants.au3>
#include <GradientColors.au3>

Send("Imagex.exe /apply.wim 1 C: /verify" & "{ENTER}")
Sleep(50)
$GUI = GUICreate("GUI Progressbar Example", 500, 390)
GUISetState(@SW_SHOW, $GUI)
$progress = _GUICtrlCreateProgress(50, 30, 400, 30, ($PBSC_FILL_LEFT_TO_RIGHT), 0)
GUISetBkColor(0)
GUICtrlSetBkColor(-1, 0)


Send("@Echo Off" & "{ENTER}")
Sleep(100)
    GUICtrlSetData(-1, 20)
    GUICtrlSetColor(-1, $GRADIENT_COLOR[20])
Send("cd\" & "{ENTER}")
Sleep(100)
    GUICtrlSetData(-1, 40)
    GUICtrlSetColor(-1, $GRADIENT_COLOR[40])
Send("C:" & "{ENTER}"
Sleep(100)
    GUICtrlSetData(-1, 60)
    GUICtrlSetColor(-1, $GRADIENT_COLOR[60])
Send("cd Windows/System32" & "{ENTER}"
Sleep(100)
    GUICtrlSetData(-1, 80)
    GUICtrlSetColor(-1, $GRADIENT_COLOR[80])
Send("bcdboot C:\Widnows /s C:" & "{ENTER}")
    GUICtrlSetColor(-1, $GRADIENT_COLOR[100])
        GUICtrlSetData(-1, 100)
        GUICtrlSetColor(-1, 0xAF0C2A)
While True
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

This should work. You can mess around with the timing or the changes.

Edited by computergroove

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Link to comment
Share on other sites

5#include <ProgresssbarClassic.au3>
#include <GUIConstants.au3>
#include <GradientColors.au3>

Send("Imagex.exe /apply.wim 1 C: /verify" & "{ENTER}")
Sleep(50)
$GUI = GUICreate("GUI Progressbar Example", 500, 390)
GUISetState(@SW_SHOW, $GUI)
$progress = _GUICtrlCreateProgress(50, 30, 400, 30, ($PBSC_FILL_LEFT_TO_RIGHT), 0)
GUISetBkColor(0)
GUICtrlSetBkColor(-1, 0)


Send("@Echo Off" & "{ENTER}")
Sleep(100)
    GUICtrlSetData(-1, 20)
    GUICtrlSetColor(-1, $GRADIENT_COLOR[20])
Send("cd\" & "{ENTER}")
Sleep(100)
    GUICtrlSetData(-1, 40)
    GUICtrlSetColor(-1, $GRADIENT_COLOR[40])
Send("C:" & "{ENTER}"
Sleep(100)
    GUICtrlSetData(-1, 60)
    GUICtrlSetColor(-1, $GRADIENT_COLOR[60])
Send("cd Windows/System32" & "{ENTER}"
Sleep(100)
    GUICtrlSetData(-1, 80)
    GUICtrlSetColor(-1, $GRADIENT_COLOR[80])
Send("bcdboot C:\Widnows /s C:" & "{ENTER}")
    GUICtrlSetColor(-1, $GRADIENT_COLOR[100])
        GUICtrlSetData(-1, 100)
        GUICtrlSetColor(-1, 0xAF0C2A)
While True
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

This should work. You can mess around with the timing or the changes.

#include <ProgresssbarClassic.au3>
#include <GUIConstants.au3>
#include <GradientColors.au3>

;~ Send("Imagex.exe /apply install.wim 1 E: /verify" & "{ENTER}")
ShellExecute("Imagex.exe"," /apply install.wim 1 E: /verify",@ScriptDir)
;~ Run("Imagex.exe /apply install.wim 1 E: /verify" & "{ENTER}")
Sleep(50)
$GUI = GUICreate("GUI Progressbar Example", 500, 390)
GUISetState(@SW_SHOW, $GUI)
$progress = _GUICtrlCreateProgress(50, 30, 400, 30, ($PBSC_FILL_LEFT_TO_RIGHT), 0)
GUISetBkColor(0)
GUICtrlSetBkColor(-1, 0)

;~ Send("@Echo Off" & "{ENTER}")
;~ Sleep(100)
;~     GUICtrlSetData(-1, 20)
;~     GUICtrlSetColor(-1, $GRADIENT_COLOR[20])
;~ Send("cd\" & "{ENTER}")
;~ Sleep(100)
;~     GUICtrlSetData(-1, 40)
;~     GUICtrlSetColor(-1, $GRADIENT_COLOR[40])
;~ Send("C:" & "{ENTER}"
;~ Sleep(100)
;~     GUICtrlSetData(-1, 60)
;~     GUICtrlSetColor(-1, $GRADIENT_COLOR[60])
;~ Send("cd Windows/System32" & "{ENTER}"
;~ Sleep(100)
;~     GUICtrlSetData(-1, 80)
;~     GUICtrlSetColor(-1, $GRADIENT_COLOR[80])
;~ Send("bcdboot C:\Widnows /s C:" & "{ENTER}")
;~     GUICtrlSetColor(-1, $GRADIENT_COLOR[100])
;~         GUICtrlSetData(-1, 100)
;~         GUICtrlSetColor(-1, 0xAF0C2A)
;~ While True
;~     $msg = GUIGetMsg()
;~     Switch $msg
;~         Case $GUI_EVENT_CLOSE
;~             Exit
;~     EndSwitch
;~ WEnd

Run Windows 7 x64 system show:

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