Forum Discussion
Saani05
Oct 29, 2021Copper Contributor
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 bla...
Mousefluff
Nov 10, 2021Iron Contributor
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