abbodi1406's Batch Scripts Repo

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

  1. mzakho

    mzakho MDL Member

    Nov 22, 2008
    166
    73
    10
    thanks and appreciation for all your hard work

    Best regards
     
  2. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,201
    90,735
    340
    #1722 abbodi1406, Dec 1, 2021
    Last edited: Dec 2, 2021
    (OP)
    uup-converter v75

    - Added manual configuration option LCUwinre (same option as W10UI)
    - Added support to install Windows 11 Combined UUP .msu file directly
    - Added support to repack Windows 11 LCU cab/psf as Combined UUP .msu file (require *.AggregatedMetadata*.cab at least)



    W10UI v10.15

    - Added support to install Windows 11 Combined UUP .msu file directly
     
  3. Paul Mercer

    Paul Mercer MDL Expert

    Apr 6, 2018
    1,941
    4,162
    60
    #1723 Paul Mercer, Dec 2, 2021
    Last edited: Dec 2, 2021
    Just tested uup-converter v75 with 22000.348 build
    DesktopDeployment_73b5000d.cab can be renamed to DesktopDeployment_348 for example, but I can't rename 6dedc052-e4e5-451b-a339-e982591a5a9a.AggregatedMetadata_ebcb96d8.cab to simple AggregatedMetadata.cab filename
    Is it possible to change filename mask to *AggregatedMetadata.cab* and don't break existing *.AggregatedMetadata.cab* filename mask in uup-converter?

    Also W10UI v10.15 can't remove all temporary files for me on 22000.318 ru-RU build. It says access denied, and Windows Defender was disabled
    windows10.0-kb5007262-x64_LCU_348.1.8.msu was from Microsoft's Catalog
    However I was able to remove temp folder manually after system reboot

    Here is W10UI log, this error is reproducing on two VMs with clean install 22000.318 ru-RU build

    Code:
    ============================================================
    Running W10UI v10.15
    ============================================================
    
    ============================================================
    Extracting .cab files from .msu files...
    ============================================================
    
    1/1: windows10.0-kb5007262-x64_LCU_348.1.8.msu [Combined UUP]
    
    ============================================================
    Extracting files from update cabinets (.cab)...
    *** This will require some disk space, please be patient ***
    ============================================================
    
    1/3: windows10.0-kb5007292-x64-ndp48_CU_4455.1.cab [NetFx]
    2/3: Windows10.0-KB5007414-x64_inout.cab [SSU]
    3/3: windows10.0-kb5007575-x64_DU.Critical_345.1.1.cab
    
    ============================================================
    Checking Updates...
    ============================================================
    
    ============================================================
    Installing servicing stack update...
    ============================================================
    
    Deployment Image Servicing and Management tool
    Version: 10.0.22000.1
    
    Image Version: 10.0.22000.318
    
    Processing 1 of 1 - Adding package Package_for_ServicingStack_345~31bf3856ad364e35~amd64~~22000.345.1.0
    [==========================100.0%==========================]
    The operation completed successfully.
    
    ============================================================
    Installing updates...
    ============================================================
    
    Deployment Image Servicing and Management tool
    Version: 10.0.22000.1
    
    Image Version: 10.0.22000.318
    
    Processing 1 of 2 - Adding package Package_for_DotNetRollup~31bf3856ad364e35~amd64~~10.0.4455.1
    [==========================100.0%==========================]
    Processing 2 of 2 - Adding package Package_for_KB5007575~31bf3856ad364e35~amd64~~22000.345.1.1
    [==========================100.0%==========================]
    The operation completed successfully.
    
    windows10.0-kb5007262-x64_LCU_348.1.8.msu
    
    Deployment Image Servicing and Management tool
    Version: 10.0.22000.1
    
    Image Version: 10.0.22000.318
    
    Processing 1 of 1 - Install
    [==========================100.0%==========================] The operation completed successfully.
    
    ============================================================
    Removing temporary extracted files...
    ============================================================
    
    C:\W10UItemp_15409\5CA961~1\metadata\WINDOW~1.0-K - Отказано в доступе.
    C:\W10UItemp_15409\5CA961~1\PACKAG~1.8 - Отказано в доступе.
    
    ============================================================
       Finished
    ============================================================
    
    
    ============================================================
    System restart is required to complete installation
    ============================================================
    
    
    Press 9 to exit.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,201
    90,735
    340
    @Paul Mercer

    you don't need to rename the files

    but if you want to distinguish them, this should work:
    348.DesktopDeployment.cab or DesktopDeployment_348.cab
    348.AggregatedMetadata.cab
     
  5. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,767
    7,702
    210
    When using the uup-converter v75 for Windows 11 Dev version 22509.1000 with enabling NetFx3 option, there is an error message right after the DISM command "Enabling feature(s)" successfully completed.
    From memory, it's telling me that "The file name, directory name or volume name is invalid" or the like. I couldn't identify the line that causes this, but it must be one of the ones that are new in v75.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,656
    103,429
    450
    #1726 Enthousiast, Dec 2, 2021
    Last edited: Dec 2, 2021
    Maybe:
    Code:
    for %%# in (%netmsu%) do %_dism2%:"!_cabdir!" %dismtarget% /LogPath:"%_dLog%\DismNetFx3.log" /Add-Package /PackagePath:"!_UUP!\%%#"
    
    ?
    [​IMG]
    Just guessing when comparing the 2 script versions:)
     
  7. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,201
    90,735
    340
    I hate small typos
    Code:
    if defined netroll "set netxtr=%netroll%"
    if defined netlcu "set netxtr=%netxtr% %netlcu%"
    should be
    Code:
    if defined netroll set "netxtr=%netroll%"
    if defined netlcu set "netxtr=%netxtr% %netlcu%"
    uup-converter v75 fixed
     
  8. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,767
    7,702
    210
    Do I need to re-do that specific ISO, then?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,201
    90,735
    340
    No
    the NDP update is correctly processed nevertheless

    the issue would be if there is LCU update available
     
  10. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,767
    7,702
    210
    Alrighty, then. :cool:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,201
    90,735
    340
  12. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,656
    103,429
    450
    Confirmed:
    Code:
    Feature Name : NetFx3
    State : Enable Pending
     
  13. xCyBx

    xCyBx MDL Senior Member

    Aug 6, 2018
    356
    718
    10
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. Still states netfx3 in pending :eek:
     
  15. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,201
    90,735
    340
    Is PSFX2MSU.cmd a proper script name for the upcoming standalone PSFX MSU Maker?
     
  16. Mr.X

    Mr.X MDL Guru

    Jul 14, 2013
    8,556
    15,642
    270
    More clear than water, impossible.
     
  17. AeonX

    AeonX MDL Addicted

    May 24, 2013
    796
    725
    30
    Nothing unusual about it .net 3.5 is always in pending state.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  18. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,656
    103,429
    450
    Offline enabling .netfx35 always sets the pending flag.

    This was to confirm .netfx35 was properly enabled with the error shown.
     
  19. #1739 Deleted member 1385001, Dec 4, 2021
    Last edited by a moderator: Dec 4, 2021
    But sir according to my scenario when i use w10ui to update base iso's without net35 enable then used msmg toolkit to remove packages only then use my own script to slim down iso plus in last when i enable net35 using dvd sources sxs as source for enabling net 35 then cross check its states enabled & restart to possible.

    i can run whole process again for you & post logs here .

    I have again executed only my script on base 11 iso & i am posting its complete log pl cross check at end before wim index is saved & unmounted :
    Code:
    *****************************************************************
    ------------------- Ensure Admin Privileges ---------------------
    *****************************************************************
                      Got Administrator Privilege
    *****************************************************************
    
    *****************************************************************
    Tweaker Script Started at 04-Dec-21 14:58:01.85
    *****************************************************************
    
    *****************************************************************
    --- Extract ISO to Script Path and Create Mount Directory
    *****************************************************************
    
    7-Zip 21.06 (x64) : Copyright (c) 1999-2021 Igor Pavlov : 2021-11-24
    
    Scanning the drive for archives:
    1 file, 4272680960 bytes (4075 MiB)
    
    Extracting archive: ISO\Win11_22000.iso
    --
    Path = ISO\Win11_22000.iso
    Type = Udf
    Physical Size = 4272680960
    Comment = CPRA_X64FRE_EN-US_DV5
    Cluster Size = 2048
    Created = 2021-06-05 15:49:17
    
    Everything is Ok
    
    Folders: 84
    Files: 933
    Size:       4281192958
    Compressed: 4272680960
    *****************************************************************
    
    *****************************************************************
    --- Export Single WIM Index of Your Choice to Script Path
    *****************************************************************
     Wim Image contain following 1 indexes :
    
      [1] Windows 11 Pro
    
    Single Image Index Number You Want to Export :1
    
    Deployment Image Servicing and Management tool
    Version: 10.0.22000.1
    
    Exporting image
    [==========================100.0%==========================]
    The operation completed successfully.
    *****************************************************************
    
    *****************************************************************
    --- Move Back Exported WIM Image to its Source Path
    *****************************************************************
            1 file(s) moved.
    *****************************************************************
    
    *****************************************************************
    --- Mount WIM Images to Mount Directory
    *****************************************************************
    --- Export Boot Wim All Indexes to Compress Maximum
    
    Deployment Image Servicing and Management tool
    Version: 10.0.22000.1
    
    Exporting image
    [==========================100.0%==========================]
    Exporting image
    [==========================100.0%==========================]
    The operation completed successfully.
    
    --- Moving Boot Wim Back to its Source Directory
            1 file(s) moved.
    
    --- Mount Install Wim
    
    Deployment Image Servicing and Management tool
    Version: 10.0.22000.1
    
    Mounting image
    [==========================100.0%==========================]
    The operation completed successfully.
    *****************************************************************
    
    *****************************************************************
    --- Remove SystemApps
    *****************************************************************
    --- Loading offline Hive & Set Perms
    The operation completed successfully.
    Processing ACL of: <machine\OfflineSOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\InboxApplications>
    
    SetACL finished successfully.
    Processing ACL of: <machine\OfflineSOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\InboxApplications>
    
    SetACL finished successfully.
    
    --- Remove Non Removable SystemApps
    VERBOSE: Performing the operation "Remove Key" on target "Item:
    HKEY_LOCAL_MACHINE\OfflineSOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\InboxApplications\Microsoft.Windows.Search_1.16.0.22000_neutral_neutral_cw5n1h2txyewy".
    The operation completed successfully.
    *****************************************************************
    
    *****************************************************************
    --- Enable Net Framework 3.5 Windows Feature
    *****************************************************************
    
    Deployment Image Servicing and Management tool
    Version: 10.0.22000.1
    
    Image Version: 10.0.22000.1
    
    Enabling feature(s)
    [==========================100.0%==========================]
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.22000.1
    
    Image Version: 10.0.22000.1
    
    Feature Information:
    
    Feature Name : NetFx3
    Display Name : .NET Framework 3.5 (includes .NET 2.0 and 3.0)
    Description : .NET Framework 3.5 (includes .NET 2.0 and 3.0)
    Restart Required : Possible
    State : Enabled
    
    Custom Properties:
    
    FWLink : http://go.microsoft.com/fwlink/?LinkId=296822
    
    The operation completed successfully.
    *****************************************************************
    
    *****************************************************************
    --- Saving and Unmounting Final Tweaked Image
    *****************************************************************
    
    Deployment Image Servicing and Management tool
    Version: 10.0.22000.1
    
    Saving image
    [==========================100.0%==========================]
    Unmounting image
    [==========================100.0%==========================]
    The operation completed successfully.
    *****************************************************************
    
    *****************************************************************
    --- Export Wim Image Again to Compress Maximum
    *****************************************************************
    
    Deployment Image Servicing and Management tool
    Version: 10.0.22000.1
    
    Exporting image
    [==========================100.0%==========================]
    The operation completed successfully.
            1 file(s) moved.
    *****************************************************************
    
    *****************************************************************
    --- Reduce ISO Layout to Maximum Extent
    *****************************************************************
    --- Reduced ISO Layout to Maximum Extent
    *****************************************************************
    
    *****************************************************************
    --- Add $OEM$ Pack if Exist Next to Script
    *****************************************************************
    *****************************************************************
    
    *****************************************************************
    --- Create Final Windows Tweaked ISO
    *****************************************************************
    
    OSCDIMG 2.56 CD-ROM and DVD-ROM Premastering Utility
    Copyright (C) Microsoft, 1993-2012. All rights reserved.
    Licensed only for producing Microsoft authorized content.
    
    
    Scanning source tree
    Scanning source tree complete (71 files in 15 directories)
    
    Computing directory information complete
    
    Image file is 3496443904 bytes (before optimization)
    
    Writing 71 files in 15 directories to Win11_Tweaked.iso
    
    100% complete
    
    Storage optimization saved 20 files, 14192640 bytes (1% of image)
    
    After optimization, image file is 3482447872 bytes
    Space saved because of embedding, sparseness or optimization = 14192640
    
    Done.
    *****************************************************************
    
    *****************************************************************
    --- Remove Extra Files of Project
    *****************************************************************
    
    Deployment Image Servicing and Management tool
    Version: 10.0.22000.1
    
    Scanning drive Z for stale files
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.22000.1
    
    Cleaning up image
    Scanning drive Z for stale files
    The operation completed successfully.
    *****************************************************************
    Tweaker Script Completed at 04-Dec-21 15:13:46.82
    *****************************************************************
    
    what i do is i only enable netfx3 feature at very end of wim servicing & no any other task is performed to it afterwards just before commiting changes & unmounting it then repacking final iso via oscdimg.
    never seen pending state according to my own scenarios.
     
    according to my scaenario its not . its enabled offline but in last before commiting changes to wim index i am servicing .