Jump to content

Modifying DISM_ProgressBar

Recommended Posts


Hello. I created a script that I can use to use a menu for DISM. I found a program called wimlib-imagex that will do some things like dism. I want to show my own progress bar. When I use dism to split a wim file, it does not show a percentage. When I use wimlib-imagex, it shows this:

D:\Test>wimlib-imagex split "d:\test\boot.wim" "d:\test\split.swm" 50 --check
[WARNING] "d:\test\boot.wim" does not contain integrity information.  Skipping integrity check.
Writing "d:\test\split.swm" (part 1 of 6): 0 MiB of 258 MiB (0%) written
Writing "d:\test\split2.swm" (part 2 of 6): 49 MiB of 258 MiB (19%) written
Writing "d:\test\split3.swm" (part 3 of 6): 99 MiB of 258 MiB (38%) written
Writing "d:\test\split4.swm" (part 4 of 6): 149 MiB of 258 MiB (57%) written
Writing "d:\test\split5.swm" (part 5 of 6): 199 MiB of 258 MiB (76%) written
Writing "d:\test\split6.swm" (part 6 of 6): 248 MiB of 258 MiB (96%) written
Finished writing split WIM part 6 of 6

Since the percentage is on a new line, how do I modify DISM_ProgressBar function in my script to pick up the percentage. Any help would be appreciated. The wimlib-imagex is for a amd64 computer.

DISM GUI Array 1.au3



Share this post

Link to post
Share on other sites

I'd use a variation of this to grab those values from the console

        $Read = StdoutRead($DSK, True, False)
        $Str = StringInStr($Read, 'Microsoft Windows')
    Until $Str <> 0
    StdinWrite($DSK, "netsh wlan show profiles" & @CRLF)
        $Read = StdoutRead($DSK, True, False)
        $Str1 = StringInStr($Read, 'All User Profile', 0, 2)
    Until $Str1 <> 0
    $Read = StdoutRead($DSK, True, False)
    Local $Spl = StringSplit($Read, 'All User Profile     : ', 1)
    For $i = 2 To $Spl[0]
        Local $SplR = StringStripWS($Spl[$i], 7)
        $Str1 = StringInStr($SplR, @ScriptDir & '>')
        If $Str1 <> 0 Then
            $StrL = StringLen(@ScriptDir)
            $StrTrim = StringTrimRight($SplR, $StrL + 2)
            GUICtrlCreateListViewItem($StrTrim & '|', $Listview)
            GUICtrlSendMsg($Listview, $LVM_SETCOLUMNWIDTH, 0, -1)
            GUICtrlCreateListViewItem($SplR & '|', $Listview)
            GUICtrlSendMsg($Listview, $LVM_SETCOLUMNWIDTH, 0, -1)

Nevermind the stringsplits and listview, focus on the StdinWrite and Read.


Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples


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


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.