(continued)

Winre.wim is essential for the operation to succeed, and of course, you need the version that matches your Windows installation. The best place for it is in a 450MB Microsoft Reserved partition right behind the Windows partition, but mine was not there. It can be located in C:\Recovery\WindowsRE (which is a protected folder), but mine was not there, either. It can be in C:\Windows\System32\Recovery (also a protected folder), but mine wasn't there, either. If you should find Winre.wim in any of those locations, be sure to check the file date; it may be from an earlier version of Windows 10/11, and you need the file version to match your installation of Windows 10/11.

But all is not lost, it can be extracted from the installation media using Dism.exe. It's located in \Sources\Install.esd (esd is a more compressed version of wim). There are lots of instructions on the internet for extracting Winre.wim from Install.wim, and plenty of instructions on the internet for converting install.esd to install.wim. You should already have installation media, either an ISO you can mount, a DVD you can open, or a USB thumb drive you can plug in.

Then you need a place to put the various parts. I put a folder named WIM on the root of G: drive. Then in File Explorer navigated to my installation thumb drive, then to \Sources and found install.esd, right-clicked and copied it, then pasted it into my G:\WIM folder.

Next I opened an elevated Command Prompt, and navigated to G:\WIM. This eliminates having to type in long paths for the files; everything is in the folder your working from. I typed

dism /get-wiminfo /wimfile:install.esd

and hit Enter. My Install.esd folder had 7 versions of Windows 10, and the one I needed was Index:6, Windows 10 Pro. Next I typed

dism /export-image /sourceimagefile:install.esd /sourceindex:6 /destinationimagefile:install.wim /compress:max /checkintegrity

and hit Enter. This one takes a while. Now I had install.esd and install.wim in my G:\WIM folder. Next I needed to mount install.wim, but it has to be mounted into an empty directory, so I created a subfolder to my WIM folder and named it Mount. Next I typed

dism /mount-image /imagefile:install.wim /index:1 /mountdir:g:\wim\mount

and hit Enter. This one doesn't take quite as long. And note that I used index:1 because I extracted only one install.wim from install.esd.

The extracted install.wim looks like a bare installation of Windows with all the default folders and files. Winre.wim is located in \Windows\System32\Recovery. Once Winre.wim has been safely copied to somewhere you can remember (like the WIM folder), we can unmount the image file. In the elevated Command Prompt type

dism /unmount-image /mountdir:g:\wim\mount /discard

This one takes a little while, as well.

The built-in

Windows Recovery Environment can be extremely useful for sorting out problems with Windows; other useful tools can also be added to WindowsRE.