Forum Discussion

Saani05's avatar
Saani05
Copper Contributor
Oct 29, 2021

Windows 11 update failed, going into endless loop

I got notification to Upgrade to Windows11. It got installed but during configuration it restarted. Now it's now showing "Preparing Automatic Repair " and after 10 mins or so getting on to another black screen "Reconstructing cache metadata". Since the laptop is pretty new, I don't have any recovery point created. And I don't want to reinstall OS as I will loose my important data on it. Please suggest solution.

7 Replies

  • Mousefluff's avatar
    Mousefluff
    Iron Contributor

    Saani05

    Here's an example of my WinPE scripts (x64) used to make the image itself:

    @ECHO OFF
    SETLOCAL
    REM NOTE: This could ONLY work when the ADK with the WinPE addon is ALREADY installed, and this batch file is run from the environment itself.
    REM NOTE: Some of the syntax / arguments have to be changed, such as the path for the USB Drive (if this is going to work properly.)
    
    REM These 3 lines below show how to INSTALL the ADK and WinPE Addon first -> 
    REM "Download the Windows ADK for Windows 11" -> https://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install#download-the-adk-for-windows-11
    REM "Download the Windows ADK for Windows 11" -> https://go.microsoft.com/fwlink/?linkid=2165884
    REM "Download the Windows PE add-on for the ADK" -> https://go.microsoft.com/fwlink/?linkid=2166133
    
    REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-create-usb-bootable-drive#create-a-bootable-winpe-usb-drive
    REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-adding-powershell-support-to-windows-pe
    REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-mount-and-customize
    REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-optimize
    
    REM Run this first: copype amd64 "C:\WinPE_amd64_PS"
    REM ----------------------------------------------------------------------------------------------------
    
    DISM /Mount-Image /ImageFile:"C:\WinPE_amd64_PS\media\sources\boot.wim" /Index:1 /MountDir:"C:\WinPE_amd64_PS\mount"
    REM "By default, this is 512MB for PCs with more than 1GB of RAM, otherwise the default is 32MB. Valid values are 32, 64, 128, 256, or 512."
    DISM /Set-ScratchSpace:512 /Image:"C:\WinPE_amd64_PS\mount"
    MKDIR "C:\Scritch_Scratch"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\lp.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-Fonts-Legacy.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-FontSupport-WinRE.cab"
    
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-WMI.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-WMI_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-NetFx.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-NetFx_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-Scripting.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-Scripting_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-PowerShell.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-PowerShell_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-StorageWMI.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-StorageWMI_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-DISMCmdlets.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-DISMCmdlets_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-SecureBootCmdlets.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-SecureStartup.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-SecureStartup_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-PlatformId.cab"
    
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-WinReCfg.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-WinReCfg_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-PPPoE.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-PPPoE_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-RNDIS.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-RNDIS_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-HTA.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-HTA_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-Dot3Svc.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-Dot3Svc_en-us.cab"
    
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-EnhancedStorage.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-EnhancedStorage_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-FMAPI.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-PmemCmdlets.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-PmemCmdlets_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-WDS-Tools.cab"
    DISM /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-WDS-Tools_en-us.cab"
    
    DISM /Cleanup-Image /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /StartComponentCleanup /ResetBase
    COPY "C:\SysinternalsSuite\Sdelete64.exe" "C:\WinPE_amd64_PS\mount\windows\system32"
    DISM /Image:"C:\WinPE_amd64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /Optimize-Image /Boot 
    DISM /Unmount-Image /MountDir:"C:\WinPE_amd64_PS\mount" /Commit
    DISM /Cleanup-Mountpoints
    RMDIR /S /Q "C:\Scritch_Scratch"
    DISM /Export-Image /SourceImageFile:"C:\WinPE_amd64_PS\media\sources\boot.wim" /SourceIndex:1 /DestinationImageFile:"C:\WinPE_amd64_PS\mount\boot2.wim"
    DEL "C:\WinPE_amd64_PS\media\sources\boot.wim"
    COPY "C:\WinPE_amd64_PS\mount\boot2.wim" "C:\WinPE_amd64_PS\media\sources\boot.wim"
    DEL "C:\WinPE_amd64_PS\mount\boot2.wim"
    
    REM Choose one or the other below, pick whatever output directory and name works: 
    REM MakeWinPEMedia /ISO C:\WinPE_amd64_PS C:\WinPE_amd64_PS\WinPE_amd64_PS.iso
    REM MakeWinPEMedia /UFD C:\WinPE_amd64_PS G:
    REM oscdimg -m -o -u1 -udfver102 -lWIN_PE_X64 -bootdata:2#p0,e,b"C:\WinPE_amd64_PS\fwfiles\etfsboot.com"#pEF,e,b"C:\WinPE_amd64_PS\fwfiles\efisys.bin" "C:\WinPE_amd64_PS\media" "P:\ISO\WinPE_Win11_English_x64.iso"

    For x86:

    @ECHO OFF
    SETLOCAL
    REM NOTE: This could ONLY work when the ADK with the WinPE addon is ALREADY installed, and this batch file is run from the environment itself.
    REM NOTE: Some of the syntax / arguments have to be changed, such as the path for the USB Drive (if this is going to work properly.)
    
    REM These 3 lines below show how to INSTALL the ADK and WinPE Addon first -> 
    REM "Download the Windows ADK for Windows 11" -> https://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install#download-the-adk-for-windows-11
    REM "Download the Windows ADK for Windows 11" -> https://go.microsoft.com/fwlink/?linkid=2165884
    REM "Download the Windows PE add-on for the ADK" -> https://go.microsoft.com/fwlink/?linkid=2166133
    
    REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-create-usb-bootable-drive#create-a-bootable-winpe-usb-drive
    REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-adding-powershell-support-to-windows-pe
    REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-mount-and-customize
    REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-optimize
    
    REM Run this first: copype x86 "C:\WinPE_x86_PS"
    REM ----------------------------------------------------------------------------------------------------
    
    DISM /Mount-Image /ImageFile:"C:\WinPE_x86_PS\media\sources\boot.wim" /Index:1 /MountDir:"C:\WinPE_x86_PS\mount"
    REM "By default, this is 512MB for PCs with more than 1GB of RAM, otherwise the default is 32MB. Valid values are 32, 64, 128, 256, or 512."
    DISM /Set-ScratchSpace:64 /Image:"C:\WinPE_x86_PS\mount"
    MKDIR "C:\Scritch_Scratch"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\lp.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-Fonts-Legacy.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-FontSupport-WinRE.cab"
    
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-WMI.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-WMI_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-NetFx.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-NetFx_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-Scripting.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-Scripting_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-PowerShell.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-PowerShell_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-StorageWMI.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-StorageWMI_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-DISMCmdlets.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-DISMCmdlets_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-SecureBootCmdlets.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-SecureStartup.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-SecureStartup_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-PlatformId.cab"
    
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-WinReCfg.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-WinReCfg_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-PPPoE.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-PPPoE_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-RNDIS.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-RNDIS_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-HTA.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-HTA_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-Dot3Svc.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-Dot3Svc_en-us.cab"
    
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-EnhancedStorage.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-EnhancedStorage_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-FMAPI.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-WDS-Tools.cab"
    DISM /Add-Package /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-WDS-Tools_en-us.cab"
    
    DISM /Cleanup-Image /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /StartComponentCleanup /ResetBase
    COPY "C:\SysinternalsSuite\Sdelete.exe" "C:\WinPE_x86_PS\mount\windows\system32"
    DISM /Image:"C:\WinPE_x86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /Optimize-Image /Boot 
    DISM /Unmount-Image /MountDir:"C:\WinPE_x86_PS\mount" /Commit
    DISM /Cleanup-Mountpoints
    RMDIR /S /Q "C:\Scritch_Scratch"
    DISM /Export-Image /SourceImageFile:"C:\WinPE_x86_PS\media\sources\boot.wim" /SourceIndex:1 /DestinationImageFile:"C:\WinPE_x86_PS\mount\boot2.wim"
    DEL "C:\WinPE_x86_PS\media\sources\boot.wim"
    COPY "C:\WinPE_x86_PS\mount\boot2.wim" "C:\WinPE_x86_PS\media\sources\boot.wim"
    DEL "C:\WinPE_x86_PS\mount\boot2.wim"
    
    REM Choose one or the other below, pick whatever output directory and name works: 
    REM MakeWinPEMedia /ISO C:\WinPE_x86_PS C:\WinPE_x86_PS\WinPE_x86_PS.iso
    REM MakeWinPEMedia /UFD C:\WinPE_x86_PS G:
    REM oscdimg -m -o -u1 -udfver102 -lWIN_PE_X86 -bootdata:2#p0,e,b"C:\WinPE_x86_PS\fwfiles\etfsboot.com"#pEF,e,b"C:\WinPE_x86_PS\fwfiles\efisys.bin" "C:\WinPE_x86_PS\media" "P:\ISO\WinPE_Win11_English_x86.iso"

    For ARM64, haven't fully tested this one yet, but I'm sure it boots:

    @ECHO OFF
    SETLOCAL
    REM NOTE: This could ONLY work when the ADK with the WinPE addon is ALREADY installed, and this batch file is run from the environment itself.
    REM NOTE: Some of the syntax / arguments have to be changed, such as the path for the USB Drive (if this is going to work properly.)
    
    REM These 3 lines below show how to INSTALL the ADK and WinPE Addon first -> 
    REM "Download the Windows ADK for Windows 11" -> https://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install#download-the-adk-for-windows-11
    REM "Download the Windows ADK for Windows 11" -> https://go.microsoft.com/fwlink/?linkid=2165884
    REM "Download the Windows PE add-on for the ADK" -> https://go.microsoft.com/fwlink/?linkid=2166133
    
    REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-create-usb-bootable-drive#create-a-bootable-winpe-usb-drive
    REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-adding-powershell-support-to-windows-pe
    REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-mount-and-customize
    REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-optimize
    
    REM Run this first: copype ARM64 "C:\WinPE_ARM64_PS"
    REM ----------------------------------------------------------------------------------------------------
    
    DISM /Mount-Image /ImageFile:"C:\WinPE_ARM64_PS\media\sources\boot.wim" /Index:1 /MountDir:"C:\WinPE_ARM64_PS\mount"
    REM "By default, this is 512MB for PCs with more than 1GB of RAM, otherwise the default is 32MB. Valid values are 32, 64, 128, 256, or 512."
    DISM /Set-ScratchSpace:512 /Image:"C:\WinPE_ARM64_PS\mount"
    MKDIR "C:\Scritch_Scratch"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\en-us\lp.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\WinPE-Fonts-Legacy.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\WinPE-FontSupport-WinRE.cab"
    
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\WinPE-WMI.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\en-us\WinPE-WMI_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\WinPE-NetFx.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\en-us\WinPE-NetFx_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\WinPE-Scripting.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\en-us\WinPE-Scripting_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\WinPE-PowerShell.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\en-us\WinPE-PowerShell_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\WinPE-StorageWMI.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\en-us\WinPE-StorageWMI_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\WinPE-DISMCmdlets.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\en-us\WinPE-DISMCmdlets_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\WinPE-SecureBootCmdlets.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\WinPE-SecureStartup.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\en-us\WinPE-SecureStartup_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\WinPE-PlatformId.cab"
    
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\WinPE-WinReCfg.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\en-us\WinPE-WinReCfg_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\WinPE-PPPoE.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\en-us\WinPE-PPPoE_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\WinPE-RNDIS.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\en-us\WinPE-RNDIS_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\WinPE-HTA.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\en-us\WinPE-HTA_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\WinPE-Dot3Svc.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\en-us\WinPE-Dot3Svc_en-us.cab"
    
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\WinPE-EnhancedStorage.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\en-us\WinPE-EnhancedStorage_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\WinPE-FMAPI.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\WinPE-PmemCmdlets.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\en-us\WinPE-PmemCmdlets_en-us.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\WinPE-WDS-Tools.cab"
    DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\ARM64\WinPE_OCs\en-us\WinPE-WDS-Tools_en-us.cab"
    
    DISM /Cleanup-Image /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /StartComponentCleanup /ResetBase
    COPY "C:\SysinternalsSuite\Sdelete64a.exe" "C:\WinPE_ARM64_PS\mount\windows\system32"
    DISM /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /Optimize-Image /Boot 
    DISM /Unmount-Image /MountDir:"C:\WinPE_ARM64_PS\mount" /Commit
    DISM /Cleanup-Mountpoints
    RMDIR /S /Q "C:\Scritch_Scratch"
    DISM /Export-Image /SourceImageFile:"C:\WinPE_ARM64_PS\media\sources\boot.wim" /SourceIndex:1 /DestinationImageFile:"C:\WinPE_ARM64_PS\mount\boot2.wim"
    DEL "C:\WinPE_ARM64_PS\media\sources\boot.wim"
    COPY "C:\WinPE_ARM64_PS\mount\boot2.wim" "C:\WinPE_ARM64_PS\media\sources\boot.wim"
    DEL "C:\WinPE_ARM64_PS\mount\boot2.wim"
    
    REM Choose one or the other below, pick whatever output directory and name works: 
    REM MakeWinPEMedia /ISO C:\WinPE_ARM64_PS C:\WinPE_ARM64_PS\WinPE_ARM64_PS.iso
    REM MakeWinPEMedia /UFD C:\WinPE_ARM64_PS G:
    REM oscdimg -m -o -u1 -udfver102 -lWIN_PE_ARM64 -pEF -b"C:\WinPE_ARM64_PS\fwfiles\efisys.bin" "C:\WinPE_ARM64_PS\media" "P:\ISO\WinPE_Win11_English_ARM64.iso"

     

  • john_mccracken's avatar
    john_mccracken
    Copper Contributor

    i have a ryzen 7 with 8 cores at 3.54ghz withe 32 gig of ram with secure uefi bios and tpm chip and win10  with 500gigbyite ssd and the compatabilit thing still sayes the pc still dont meat specs.  ho will get every one to by new pcs  i guess i will just use win 10 till 2025 thin change to linux mint. if yall dont get the isusses fixed be couse not every one will be able to by new pcs. i like windows pcs but i am wondering why you are making it so hard for this upgrade do you just don want pepole to use youre software eny more or what. i am very confused about microsoft 

  • Mousefluff's avatar
    Mousefluff
    Iron Contributor

    Saani05

    If the root DACL is corrupt, run this from WinPE ONLY to reset it (this takes between 20 minutes to several hours easily, don't interrupt it either.) Once again ONLY in WinPE for system drives. The volume letter A: or A:\ obviously can be changed to match the volume letter on the offline Windows Image:

     

    REM ++++++++++----------++++++++++----------++++++++++----------++++++++++----------++++++++++----------
    REM ----------++++++++++----------++++++++++----------++++++++++----------++++++++++----------++++++++++
    
    REM Batch file to reset ACLs on WinPE for offline images only:
    
    @ECHO OFF
    SETLOCAL
    icacls A: /remove "ALL RESTRICTED APPLICATION PACKAGES" /c /l /q
    icacls A: /remove "ALL APPLICATION PACKAGES" /c /l /q
    icacls A: /remove "NT AUTHORITY\Authenticated Users" /c /l /q
    icacls A: /remove "NT SERVICE\TrustedInstaller" /c /l /q
    icacls A: /inheritance:r /grant:r "NT SERVICE\TrustedInstaller":(OI)(CI)(F) /c /l /q
    icacls A: /remove "NT AUTHORITY\SYSTEM" /c /l /q
    icacls A: /inheritance:r /grant:r "NT AUTHORITY\SYSTEM":(OI)(CI)(F) /c /l /q
    icacls A: /remove "BUILTIN\Users" /c /l /q
    icacls A: /inheritance:r /grant:r "BUILTIN\Users":(OI)(CI)(F) /c /l /q
    icacls A: /remove "BUILTIN\Administrators" /c /l /q
    icacls A: /inheritance:r /grant:r "BUILTIN\Administrators":(OI)(CI)(F) /c /l /q
    icacls A: /inheritance:r /grant:r "NT AUTHORITY\Authenticated Users":(OI)(CI)(F) /c /l /q
    icacls A: /inheritance:r /grant:r "ALL APPLICATION PACKAGES":(OI)(CI)(F) /c /l /q
    icacls A: /remove "Everyone" /c /l /q
    icacls "A:\*.*" /reset /t /c /l /q
    
    REM ----------++++++++++----------++++++++++----------++++++++++----------++++++++++----------++++++++++
    REM ++++++++++----------++++++++++----------++++++++++----------++++++++++----------++++++++++----------

     

    https://docs.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/microsoft-store-apps-fail-to-start#fix-file-system-permissions-thats-changed-manually

     

    https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-create-usb-bootable-drive?view=windows-11

     

    https://docs.microsoft.com/en-us/windows/win32/secauthz/sid-strings | https://docs.microsoft.com/en-us/windows/win32/secauthz/well-known-sids | https://docs.microsoft.com/en-us/windows/win32/secauthz/security-descriptor-string-format

     

    https://docs.microsoft.com/en-us/windows/win32/secauthz/security-descriptor-definition-language-for-conditional-aces-

     

    https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/convertfrom-sddlstring?view=powershell-7.1

     

  • Mousefluff's avatar
    Mousefluff
    Iron Contributor

    Saani05

    If you had a copy of WinPE on a USB Drive, with also the https://www.microsoft.com/software-download/windows11 from Windows 11 https://www.win-rar.com/download.html?&L=0 to the drive, this would probably work (Change A:\ to match the volume letter of the Offline Windows image.)

    REM ----------++++++++++----------++++++++++----------++++++++++----------++++++++++----------++++++++++----------++++++++++----------++++++++++
    REM Example: Restore and Optimize an offline Windows Image on a workstation PC using WinPE to reduce boot time
    MKDIR "A:\Scrtch"
    DISM /Image:A:\ /ScratchDir:"A:\Scrtch" /Cleanup-Image /RestoreHealth /Source:A:\Win11_English_x64\sources\install.wim:1 /LimitAccess
    DISM /Image:A:\ /ScratchDir:"A:\Scrtch" /Cleanup-Image /StartComponentCleanup /ResetBase
    SFC /SCANNOW /OFFBOOTDIR=A:\ /OFFWINDIR=A:\Windows
    DISM /Image:A:\ /ScratchDir:"A:\Scrtch" /Optimize-Image /WimBoot
    RMDIR /Q /S "A:\Scrtch"
    REM ----------++++++++++----------++++++++++----------++++++++++----------++++++++++----------++++++++++----------++++++++++----------++++++++++

     NOTE: The Index has to match the edition of the operating system image you want to repair / restore:

    DISM /Get-WimInfo /WimFile:"C:\Win11_English_x64\sources\install.wim"
    
    Deployment Image Servicing and Management tool
    Version: 10.0.22000.1
    
    Details for image : C:\Win11_English_x64\sources\install.wim
    
    Index : 1
    Name : Windows 11 Home
    Description : Windows 11 Home
    Size : 15,854,479,870 bytes
    
    Index : 2
    Name : Windows 11 Home N
    Description : Windows 11 Home N
    Size : 15,170,988,662 bytes
    
    Index : 3
    Name : Windows 11 Home Single Language
    Description : Windows 11 Home Single Language
    Size : 15,857,403,299 bytes
    
    Index : 4
    Name : Windows 11 Education
    Description : Windows 11 Education
    Size : 16,136,983,252 bytes
    
    Index : 5
    Name : Windows 11 Education N
    Description : Windows 11 Education N
    Size : 15,450,067,990 bytes
    
    Index : 6
    Name : Windows 11 Pro
    Description : Windows 11 Pro
    Size : 16,134,043,048 bytes
    
    Index : 7
    Name : Windows 11 Pro N
    Description : Windows 11 Pro N
    Size : 15,447,756,461 bytes
    
    Index : 8
    Name : Windows 11 Pro Education
    Description : Windows 11 Pro Education
    Size : 16,136,934,462 bytes
    
    Index : 9
    Name : Windows 11 Pro Education N
    Description : Windows 11 Pro Education N
    Size : 15,450,018,300 bytes
    
    Index : 10
    Name : Windows 11 Pro for Workstations
    Description : Windows 11 Pro for Workstations
    Size : 16,136,958,857 bytes
    
    Index : 11
    Name : Windows 11 Pro N for Workstations
    Description : Windows 11 Pro N for Workstations
    Size : 15,450,043,145 bytes

     

  • vincitechnology's avatar
    vincitechnology
    Copper Contributor
    best option i suggest would be to boot the laptop with a boot disk that can get you into a windows environment to backup your data to an external drive.
    active boot disk works quite well, but there are others available.
    and then do a clean installation of windows 11 (but you would need to download the iso/usb via the media creation tool) if you have another computer handy for that.
    • john_mccracken's avatar
      john_mccracken
      Copper Contributor
      what about all of youre installed aplication like adoby premear and all the games you have loaded and printer driver an video drivers. i dont think i am the only one how cant remember all the log ins an passwords. i dont know about every body els but it sure seams like peopleare going to loos alot of moeny spent on aplication and games. i just dont see people willing to through all that money away that they spent just to be able to keep using microsoft software. now i know why my brother hates microsoft with a pation he dont use eny windows software he uses strickly linux os.
    • Saani05's avatar
      Saani05
      Copper Contributor
      Nothing worked 😞 Ultimately had to send it to service center. Knew that they would only be able to reinstall OS, wouldn't be able to repair.

Resources