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, and you need the file version to match your installation of Windows 10.

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 ESD on the root of F: 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 F:\ESD folder.

Next I opened an elevated Command Prompt, and navigated to F:\ESD. 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.wim folder had 7 versions of Windows 10 1809, 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 F:\ESD 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 ESD folder and named it winre. Next I typed

dism /mount-image /imagefile:install.wim /index:1 /mountdir:F:\esd\winre

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 ESD folder), we can unmount the image file. In the elevated Command Prompt type

dism /unmount-image /mountdir:F:\esd\winre /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.