abbodi1406's Batch Scripts Repo

Discussion in 'Scripting' started by abbodi1406, May 4, 2017.

  1. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,201
    90,738
    340
    More info about how you used W10UI would be helpful :rolleyes:

    that error usually happens when setup.exe file is different in iso\sources and boot.wim\2\sources
     
  2. rpo

    rpo MDL Expert

    Jan 3, 2010
    1,479
    1,474
    60
    Thank you, I will try your suggestion because in spite of having a legit Windows 10 the script activated my (retail) Windows as a VL Windows. This happened once (problem with MS servers?) and now i verify that my Windows is activated before running your script (I want activate Office 2016). I restablish the Windows activation by changing the key.
     
  3. MonarchX

    MonarchX MDL Expert

    May 5, 2007
    1,732
    313
    60
    I did not edit the script. I placed W10UI 3.7 into same directory as latest updates:
    - Nov 14th 2017 SS for 1607-14393 cab file
    - Most recent 2017 CU for 1607-14393 (14393-1914) cab file
    - NetFX 4.7.1 330MB cab file
    - Most recent Adobe Flash update cab file

    Then I pointed to boot.wim, selected DISM.exe from MSMG Toolkit (16299.15), selected No for NetFX 3.5, then Yes for clean-up and Yes for re-base. Both indexes were updated successfully, but booting resulted in that missing media driver error.

    I did the same for install.wim before boot.wim and it worked flawlessly as far as actual installation went.

    To create working boot.wim, I used stock boot.wim and updated it with the latest NTLite, which used latest SS and CU on both indexes and cleaned them. Afterwards I loaded them with MSMG Toolkit to rebase them since NTLite does not do that. That worked.

    I did not keep the log for W10UI 3.7, but maybe it tried to update boot.wim with NetFX 4.7.1? Its an extracted file from offline 4.7.1 package, but it worked for install.wim and for online images (version number verified).
     
  4. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,656
    103,435
    450
    Code:
    @echo off
    cd /d "%~dp0"
    rem when changing below options, be sure to set the new values between = and " marks
    
    rem for updating current os, leave this option as %SystemDrive%
    set "target=d:\W10UI_3.7\2016_LTSB_Work_en-US_x64"
    
    rem updates location, %cd% represent the current script directory
    set "repo=d:\W10UI_3.7\2016_LTSB_Updates_x64"
    
    rem dism.exe tool path (default is system's if the host os is win10)
    set "dismroot=%windir%\system32\dism.exe"
    
    rem enable .NET 3.5 feature
    set net35=1
    
    rem optional, specify custom "folder" path for microsoft-windows-netfx3-ondemand-package.cab
    set "net35source=d:\W10UI_3.7\2016_LTSB_SXS_en-US_x64"
    
    rem Cleanup OS images to "compress" superseded components (might take long time to complete)
    set cleanup=1
    
    rem Rebase OS images to "remove" superseded components (warning: break "Reset this PC" feature)
    rem require first to set cleanup=1
    set resetbase=0
    
    rem create new iso file if the target is a distribution folder
    rem require placing oscdimg.exe or cdimage.exe next to W10UI.cmd
    set iso=1
    
    rem set this to 1 to start the process directly once you execute the script
    rem make sure you set the above options correctly first
    set autostart=0
    
    rem optional, set temporary directory for extracted files
    set "cab_dir=%~d0\W10UItemp"
    
    rem optional, set mount directory for updating wim files
    set "mountdir=%SystemDrive%\W10UImount"
    set "winremount=%SystemDrive%\W10UImountre"
    Code:
    ============================================================
    
    1. Target (x64): "d:\W10UI_3.7\2016_LTSB_Work_en-US_x64"
    
    2. Updates: "d:\W10UI_3.7\2016_LTSB_Updates_x64"
    
    3. DISM: "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\AMD64\DISM\dism.exe"
    
    4. Enable .NET 3.5: YES
    
    5. Cleanup System Image: YES      6. Reset Image Base: NO
    
    ============================================================
    0. Start the process
    ============================================================
    
    Change a menu option, press 0 to start, or 9 to exit:
    Code:
    ============================================================
    Extracting .cab files from .msu files
    ============================================================
    
    1/4: Windows10.0-KB3186568-x64.msu
    2/4: windows10.0-kb4048951-x64_9239d872b1bcc0eab8bbe01fa608f7677652497d.msu
    3/4: Windows10.0-KB4049065-x64.msu
    4/4: Windows10.0-KB4051033-x64.msu
    
    ============================================================
    Extracting files from update cabinets (.cab)
    *** This will require some disk space, please be patient ***
    ============================================================
    
    1/4: Windows10.0-KB3186568-x64.cab
    2/4: Windows10.0-KB4048951-x64.cab
    3/4: Windows10.0-KB4049065-x64.cab
    4/4: Windows10.0-KB4051033-x64.cab
    
    ============================================================
    Mounting install.wim - index 1/1
    ============================================================
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Mounting image
    [==========================100.0%==========================]
    The operation completed successfully.
    
    ============================================================
    Checking Updates...
    ============================================================
    
    
    ============================================================
    Installing servicing stack update...
    ============================================================
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Image Version: 10.0.14393.0
    
    Processing 1 of 1 - Adding package Package_for_KB4049065~31bf3856ad364e35~amd64~~10.0.1.3
    [==========================100.0%==========================]
    The operation completed successfully.
    
    ============================================================
    Installing updates...
    ============================================================
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Image Version: 10.0.14393.1883
    
    Processing 1 of 3 - Adding package Package_for_KB3186568~31bf3856ad364e35~amd64~~10.0.1.1044
    [==========================100.0%==========================]
    Processing 2 of 3 - Adding package Package_for_KB4048951~31bf3856ad364e35~amd64~~10.0.1.0
    [==========================100.0%==========================]
    Processing 3 of 3 - Adding package Package_for_RollupFix~31bf3856ad364e35~amd64~~14393.1914.1.4
    [==========================100.0%==========================]
    The operation completed successfully.
    
    ============================================================
    Cleaning up OS image
    ============================================================
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Image Version: 10.0.14393.1883
    
    [==========================100.0%==========================]
    The operation completed successfully.
    
    ============================================================
    Adding .NET Framework 3.5 feature
    ============================================================
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Image Version: 10.0.14393.1883
    
    Enabling feature(s)
    [==========================100.0%==========================]
    The operation completed successfully.
    
    ============================================================
    Reinstalling cumulative update...
    ============================================================
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Image Version: 10.0.14393.1883
    
    Processing 1 of 1 - Adding package Package_for_RollupFix~31bf3856ad364e35~amd64~~14393.1914.1.4
    [==========================100.0%==========================]
    The operation completed successfully.
    
    ============================================================
    Updating winre.wim
    ============================================================
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Mounting image
    [==========================100.0%==========================]
    The operation completed successfully.
    
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Image Version: 10.0.14393.0
    
    Processing 1 of 1 - Adding package Package_for_KB4049065~31bf3856ad364e35~amd64~~10.0.1.3
    [==========================100.0%==========================]
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Image Version: 10.0.14393.1883
    
    Processing 1 of 1 - Adding package Package_for_RollupFix~31bf3856ad364e35~amd64~~14393.1914.1.4
    [==========================100.0%==========================]
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Image Version: 10.0.14393.1883
    
    [==========================100.0%==========================]
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Image File : D:\W10UI_3.7\winre.wim
    Image Index : 1
    Saving image
    [==========================100.0%==========================]
    Unmounting image
    [==========================100.0%==========================]
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Exporting image
    [==========================100.0%==========================]
    The operation completed successfully.
    
    ============================================================
    Adding updated winre.wim
    ============================================================
    
            1 file(s) copied.
    
    ============================================================
    Unmounting install.wim - index 1/1
    ============================================================
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Image File : d:\W10UI_3.7\2016_LTSB_Work_en-US_x64\sources\install.wim
    Image Index : 1
    Saving image
    [==========================100.0%==========================]
    Unmounting image
    [==========================100.0%==========================]
    The operation completed successfully.
    
    ============================================================
    Rebuilding install.wim
    ============================================================
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Exporting image
    [==========================100.0%==========================]
    The operation completed successfully.
    
    ============================================================
    Mounting boot.wim - index 1/2
    ============================================================
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Mounting image
    [==========================100.0%==========================]
    The operation completed successfully.
    
    ============================================================
    Checking Updates...
    ============================================================
    
    
    ============================================================
    Installing servicing stack update...
    ============================================================
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Image Version: 10.0.14393.0
    
    Processing 1 of 1 - Adding package Package_for_KB4049065~31bf3856ad364e35~amd64~~10.0.1.3
    [==========================100.0%==========================]
    The operation completed successfully.
    
    ============================================================
    Installing updates...
    ============================================================
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Image Version: 10.0.14393.1883
    
    Processing 1 of 1 - Adding package Package_for_RollupFix~31bf3856ad364e35~amd64~~14393.1914.1.4
    [==========================100.0%==========================]
    The operation completed successfully.
    
    ============================================================
    Resetting WinPE image base
    ============================================================
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Image Version: 10.0.14393.1883
    
    [==========================100.0%==========================]
    The operation completed successfully.
    
    ============================================================
    Unmounting boot.wim - index 1/2
    ============================================================
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Image File : d:\W10UI_3.7\2016_LTSB_Work_en-US_x64\sources\boot.wim
    Image Index : 1
    Saving image
    [==========================100.0%==========================]
    Unmounting image
    [==========================100.0%==========================]
    The operation completed successfully.
    
    ============================================================
    Mounting boot.wim - index 2/2
    ============================================================
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Mounting image
    [==========================100.0%==========================]
    The operation completed successfully.
    
    ============================================================
    Checking Updates...
    ============================================================
    
    
    ============================================================
    Installing servicing stack update...
    ============================================================
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Image Version: 10.0.14393.0
    
    Processing 1 of 1 - Adding package Package_for_KB4049065~31bf3856ad364e35~amd64~~10.0.1.3
    [==========================100.0%==========================]
    The operation completed successfully.
    
    ============================================================
    Installing updates...
    ============================================================
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Image Version: 10.0.14393.1883
    
    Processing 1 of 1 - Adding package Package_for_RollupFix~31bf3856ad364e35~amd64~~14393.1914.1.4
    [==========================100.0%==========================]
    The operation completed successfully.
    
    ============================================================
    Resetting WinPE image base
    ============================================================
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Image Version: 10.0.14393.1883
    
    [==========================100.0%==========================]
    The operation completed successfully.
    
    ============================================================
    Unmounting boot.wim - index 2/2
    ============================================================
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Image File : d:\W10UI_3.7\2016_LTSB_Work_en-US_x64\sources\boot.wim
    Image Index : 2
    Saving image
    [==========================100.0%==========================]
    Unmounting image
    [==========================100.0%==========================]
    The operation completed successfully.
    
    ============================================================
    Rebuilding boot.wim
    ============================================================
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16299.15
    
    Exporting image
    [==========================100.0%==========================]
    Exporting image
    [==========================100.0%==========================]
    The operation completed successfully.
    
    ============================================================
    Removing temporary extracted files...
    ============================================================
    
    
    ============================================================
    Creating updated ISO file...
    ============================================================
    
    
    CDIMAGE 2.53m CD-ROM and DVD-ROM Premastering Utility
    Copyright (C) Microsoft, 1993-2007. All rights reserved.
    For Microsoft internal use only.
    
    
    Scanning source tree (500 files in 17 directories)
    Scanning source tree complete (990 files in 100 directories)
    
    Computing directory information complete
    
    Image file is 3953917952 bytes (before optimization)
    
    Writing 990 files in 100 directories to Win10_14393_Updated.iso
    
    100% complete
    
    Storage optimization saved 31 files, 14678016 bytes (1% of image)
    
    After optimization, image file is 3941509120 bytes
    Space saved because of embedding, sparseness or optimization = 14678016
    
    Done.
    
    ============================================================
       Finished
    ============================================================
    
    
    Press any key to exit.
    
    [​IMG]
    [​IMG]
    [​IMG]
    Did not experience anything weird.
     
  5. Senjanov

    Senjanov MDL Member

    Jul 29, 2011
    217
    44
    10
    #185 Senjanov, Dec 6, 2017
    Last edited: Dec 6, 2017
    I think its not because net 4.7.1
    as you can see, in log files Enthousiast, Install.wim also winre.wim/boot.wim updated with W10UI(mounting, updating also rebuilding)
    I never tried MSMG toolkit, in update files cab update, there are file needed by install.wim and boot.wim/winre.wim
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,656
    103,435
    450
    #186 Enthousiast, Dec 6, 2017
    Last edited: Dec 10, 2017
    The script will never try to integrate dotnet into winpe/winre images, whatever the settings are.

    Will redo the test with the 471 cab, extracted from the offline installer executable.

    Same working iso :)
     
  7. Senjanov

    Senjanov MDL Member

    Jul 29, 2011
    217
    44
    10
    so the script for 471 cab installing to install.wim?
    but in MonarchX problem, what exactly the problem?
    I never have problem missing driver or anything if using W10UI.. well, as a long I see your setting in many post..
    in old first try the problem net not integrate.. but see your setting, problem gone.. :D
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,656
    103,435
    450
    @abbodi1406 gave the most likely answer, but i only showed that when the script is correctly used there won't be any problems.
     
  9. Senjanov

    Senjanov MDL Member

    Jul 29, 2011
    217
    44
    10
    yup..I always use your setting.. of cource building iso for personal use and
    I may be a less active member, I just look and never ask anything or make a post.
    I wonder what to ask. I just want to learn and understand new things.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,201
    90,738
    340
    That's the problem then
    you updated each file separately
    in this case, updated setup.exe inside boot.wim will not be copied to iso\sources

    if you intend to update both wims, just point to extracted iso directory (the parent folder which contain sources folder)
    otherwise, use 7-zip to extract sources\setup.exe from boot.wim index 2
     
  11. MonarchX

    MonarchX MDL Expert

    May 5, 2007
    1,732
    313
    60
    Ohh...but why make it like that? Fully updated Install.wim can use stock boot.wim and version variance does not result in any issues, yet updating them separately to the exact same version with W10UI does? Confusing...

    MSMG Toolkit also let's you choose whether to mount boot.wim or not (for updating or whichever manipulation) which made me assume W10UI works the same way and can update each wim individually while making them compatible with each other.
     
  12. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,656
    103,435
    450
    You don't read, @abbodi1406 said, the setup.exe from boot.wim index 2 and the one in the iso\sources folder are different if you don't copy the one from boot.wim over to the sources folder, the script does that by itself when you run it on an extracted iso folder instead of two manual runs at the single wim files. The SSU updates the setup.exe inside the boot.wim index 2 but not the one in sources on the iso.
     
  13. MonarchX

    MonarchX MDL Expert

    May 5, 2007
    1,732
    313
    60
    No idea what you just said there, but I think you are correct. After all, not all hedgehogs jump ship when local spoon sales show insignificant rise of cookies consumed during church picnics when recently-built planes developed yellow rash hay stacks!
     
  14. Mr.X

    Mr.X MDL Guru

    Jul 14, 2013
    8,556
    15,642
    270
    :tooth:
     
  15. Senjanov

    Senjanov MDL Member

    Jul 29, 2011
    217
    44
    10
    esd-decrypter-wimlib-34 & esd-decrypter-wimlib-35 can it used for esd before 16299/1709 ?
    example I want to decrypt to iso, esd windows 10240, 1511, 1607 also 1703? :thinking:
    for now I want to test clientcombinedsl windows 1607, I need just pro, so updated to latest update windows :bookside:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,201
    90,738
    340
  17. Senjanov

    Senjanov MDL Member

    Jul 29, 2011
    217
    44
    10
    thank you master, :worthy:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  18. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,201
    90,738
    340
    W10UI v4.0

    - Cumulative update will now be installed separately after other updates (to avoid confliction with dynamic/.NET updates)
    - Verbose script version (thanks @Enthousiast)
    - Fixed .NET 3.5 feature enabling on Server editions (thanks @Flipp3r)
     
  19. kandido

    kandido MDL Junior Member

    Jun 14, 2015
    60
    37
    0
    So, if I would use an updated boot.wim (SStack+CU) with a non-updated install.wim, I should copy setup.exe from boot.wim index 2 to iso\sources, right?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  20. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,201
    90,738
    340
    Yes