Windows RE (Recovery Environment) is stored as a winre.wim file on device hard drive or SSD in Windows 7, 8/8.1, and 10. Windows 7 normally keeps it on the same partition/volume with Windows, while Windows 8 and later usually keep it on the hidden System Reserved partition that also contains boot files and Boot Configuration Data (BCD).
WIM is the Windows Imaging file format, the compressed package of a file-based disk image. Such disk images are used to install, upgrade, reinstall, and repair Windows. Common examples are the install.wim file on Windows installation DVD or ISO package, and the winre.wim file that this article is all about.
After someone deletes the winre.wim file or the whole recovery partition/volume where the file resides, problems start occurring. If the System Reserved partition is too small to fit winre.wim, the same errors might start to appear even after you upgrade an older version of Windows.
First, you cannot create System Repair Disc in Windows 7 or Recovery Drive in Windows 8, 8.1 and 10 with error messages The files needed to create a system repair disc were not found on this computer (Windows 7) and We can't create a recovery drive on this PC, Some required files are missing. (Windows 8, 8.1, and 10).
In Windows 7, you can resolve this problem simply by inserting the Windows installation DVD if you have one.
Second, you cannot enable the Copy contents from the recovery partition to the recovery drive (Windows 8/8.1) or the Back up system files to the recovery drive (Windows 10) option while creating a Recovery Drive. This problem requires storing Windows install.wim file on a hard drive or SSD.
Third, trying to enable Microsoft Windows Recovery Agent (reagentc.exe) results in the Operation failed: 64e Product is uninstalled error in Windows 7, and either The target Windows installation was not found or The Windows RE image was not found in Windows 8/8.1 and 10.
Again, the easiest and fastest way to resolve this in Windows 7 is by inserting Windows installation DVD and running System Repair Disc creator.
Fourth, you might be unable to use the Refresh and Reset Your PC features in Windows 8 and 8.1 because of errors A required drive partition is missing or Some files are missing, Your Windows installation or recovery media will provide these files or Could not find the recovery environment.
Fifth, after using some third-party partitioning tool (especially EaseUS Partition Master), partition ID-s can be wrong and the same errors appear even if the winre.wim file is present.
Mismatching partition identifiers also result in Windows Update error 80070003, "Windows Update ran into a problem" while upgrading to Windows 10.
If you remember using a third-party partitioning utility, please see the Fix Windows Update error 80070003 like a boss tutorial's second solution.
If you do not have any backups that could restore the missing winre.wim file, you need Windows installation media.
In case you bought a retail version of Windows 7, 8/8.1 or 10, you have the DVD or USB drive.
You need to know the correct edition and hardware architecture of the current Windows installation. The quickest way to find out details about installed Windows is to use the keyboard shortcut Windows Key+Pause. The latter key might be named Pause/Break on some keyboards.
Another method is to right-click (My) Computer orThis PC in the Start menu/screen or Desktop and select Properties from the menu.
See what's written in the Windows edition section.
To check whether your OS is 32-bit (x86) or 64-bit (x64), see the System type line.
If not, use the HeiDoc.net Microsoft Windows and Office ISO Download Tool to get the correct Windows edition for your device's hardware architecture (32- or 64-bit). Sadly, there are no download tools for Windows 8 out there.
Launch the HeiDoc download tool, choose the correct Windows version from the right, and the correct edition from the left. Click Confirm, then choose the language from the left and click Confirm again. Download ISO for the 32-bit or 64-bit hardware architecture. All settings must match your current installation of Windows 7, 8/8.1 or 10.
After downloading the 3-4 gigabyte ISO file, burn it onto a blank DVD using Windows Disc Image Burner.
Windows 8, 8.1, and 10 users can simply mount the ISO file as a virtual DVD drive by double-clicking on the file name - this adds a new drive letter in File Explorer. If you have changed the default behavior for .iso files, right-click the file instead, expand Open with and click Windows Explorer.
First, you need to make hidden and system files temporarily visible to follow this tutorial. If Windows Explorer/File Explorer is not open, launch it using keyboard shortcut Windows Key+E.
In Windows 7, press the Alt key once to reveal menus, open the Tools menu, and click Folder options.
In Windows 8/8.1 and 10, press Alt+V to reveal the Ribbon and open the View tab. Tick the Hidden items checkbox and then click Options. You can also reveal or hide Ribbon permanently using the Ctrl+F1 keyboard shortcut.
In the Folder Options window, open the View tab and scroll down until you see the Hidden files and folders section. Make sure it is set to Show hidden files, folders and drives.
Then clear the Hide extensions for known file types checkbox. This makes locating the correct files easier later in this tutorial.
Finally, untick the Hide protected operating system files (Recommended) checkbox.
Windows will warn you that deleting or editing protected system files can make the whole OS inoperable. Click Yes and please remember not to remove any of the new items visible on Desktop and in Windows/File Explorer.
Back in Windows/File Explorer, open your Windows installation media and browse to the Sources folder. Locate install.wim file, hold down the SHIFT key and right-click on the file. Choose Copy as path to store the full location of the file on Clipboard.
In some cases - for example, ISO file created by the Windows 10 Media Creation Tool, - the install.wim file might be named install.esd instead. This one works as well, but you need to convert it to the WIM format first. This is described a bit later. Please copy the path of the install.esd file to Clipboard as instructed above.
Windows 7 users should open the Start menu, type cmd, right-click the result and choose Run as administrator.
Windows 8, 8.1, and 10 users can either use the keyboard shortcut Windows Key+X to open the Quick Links menu and choose Command Prompt (Admin) or open Start screen, type cmd, right-click the result and choose Run as administrator.
Click Yes in the User Account Control window and elevated (administrator) Command Prompt opens.
First, type md c:\test\ and press Enter. This will create a folder named "test" on Windows drive.
Next, you'll mount the Windows installation disk image into this directory.
Only in case your media had the install.esd, not the install.wim file!
Type md c:\temp\ and press Enter to create a folder named "temp" on the system drive. Please note that the following conversion requires about 3-4 gigabytes of free disk space.
Type dism /export-image /SourceImageFile: , then right-click after the colon and select Paste. Finish the command by typing /SourceIndex:1 /DestinationImageFile:C:\temp\install.wim /Compress:max /CheckIntegrity
The full command should look like this: dism /export-image /SourceImageFile:"D:\Sources\install.esd" /SourceIndex:1 /DestinationImageFile:C:\temp\install.wim /Compress:max /CheckIntegrity
The command takes from 10-30 minutes to finish.
After the process completes, navigate to the C:\Temp folder with Windows/File Explorer, hold down Shift, and right-click the install.wim file. Select Copy as path.
In Windows 7, type dism /mount-wim /wimfile: , then right-click after the colon and choose Paste to add the full path to install.wim file copied to Clipboard earlier. Complete the command by typing /index:2 /mountdir:C:\test\ /readonly
The full command in this example looks like this: dism /mount-wim /wimfile:"D:\sources\install.wim" /index:2 /mountdir:C:\test\ /readonly
Press Enter to mount the image. This process takes quite some time, up to 10-15 minutes is completely normal.
Windows 8/8.1 and 10 users should type dism /mount-image /imagefile: , then right-click after the colon and choose Paste to add the full location of the install.wim file copied in a previous step. Complete the command by typing /index:1 /mountdir:C:\test\ /readonly
The full command in this example looks like this: dism /mount-image /imagefile:"D:\sources\install.wim" /index:1 /mountdir:C:\test\ /readonly
Or it might look like this if your media had the install.esd file: dism /mount-image /imagefile:"C:\temp\install.wim" /index:1 /mountdir:C:\test\ /readonly
Press ENTER to mount the image. This process can easily take up to 10-15 minutes.
After install.wim has been successfully mounted, you can browse it like any other folder. Go back to Windows/File Explorer (Alt+Tab switches between open windows), open drive with letter C: and browse to Test\Windows\System32\Recovery folder. Right-click winRE.wim file and choose Copy.
Do not close Command Prompt yet.
Now browse to C:\Windows\System32\Recovery folder, right-click in an empty space, and choose Paste. As this is a system protected folder, you'll see the Destination Folder Access Denied dialog. Click Continue to actually put the file in the directory.
Windows RE image has now been restored. Next, you need to let Recovery Agent know about it: go back to Command Prompt, type or copy-paste reagentc /setreimage /path C:\windows\system32\recovery and press Enter.
Good, winre.wim file recovery is now complete. Now you should unmount the install.wim image file.
In Windows 7, type dism /unmount-wim /mountdir:C:\test\ /discard and press Enter.
In Windows 8 and later, type dism /unmount-image /mountdir:C:\test\ /discard and press Enter.
In most cases, this is pretty much it. You just need to type reagentc /enable and press Enter to turn Windows Recovery Agent back on.
To verify that everything is ok, type reagentc /info and press Enter. In Windows 7, make sure that the "Windows RE enabled" line value is 1; in Windows 8/8.1 and 10, verify that "Windows RE status" is "Enabled".
If the "Recovery Image Location" line in Windows 10 is empty, you need to follow instructions in the next section, Resolving recovery partition trouble with Recovery Drive and "Reset this PC" failures.
Now go back to Windows or File Explorer, open Folder Options, and re-enable the Hide protected operating system files (Recommended) option to make sure that you will not delete something important accidentally in the future.
If your media had the install.esd file instead of install.wim, and Recovery Image Location has been set, it is safe to delete the C:\Temp folder now.
If you mounted Windows installation ISO with File Explorer in Windows 8 or newer, right-click the drive letter and choose Eject to unmount it.
Note: you can use the reagentc /boottore command to test out Recovery Environment right away. Upon the next restart, Windows will boot into RE automatically. This happens only once after using the command, later restarts will boot into the normal mode of Windows.
Those who have Windows 7, and those do not experience trouble with copying the recovery partition to Recovery Drive in Windows 8/8.1 or 10, can now safely close Command Prompt window and celebrate the hard work done.
Resolving recovery partition trouble with Recovery Drive and "Reset this PC" failures in Windows 8, 8.1 and 10
If you still cannot use the Copy contents from the recovery partition to the recovery drive or the Back up system files to the recovery drive option while creating a Recovery Drive, you need to copy the whole install.wim file from Windows installation media to a hard drive or SSD and register it with Windows Recovery Agent.
This also helps in case you get the There was a problem resetting your PC, No changes were made error while using the Reset this PC feature in Windows 10.
In File Explorer, create a folder on a drive with enough free space - about 3 gigabytes for 32-bit Windows and about 4 gigabytes for 64-bit Windows. For this example, I created a folder named Winstall on drive C:.
Next, open Windows installation media in File Explorer and browse to the sources folder. Now copy the install.wim file to the folder you created. Keyboard tip: Ctrl+C copies an item, Ctrl+V pastes it.
After the copying is complete, you can Shift+right-click on the file and choose Copy as path to make the next step a bit easier.
In elevated Command Prompt (open Start screen, type cmd, right-click the result and choose Run as administrator), type reagentc /setosimage /path <full path to install.wim file> /index 1 and press Enter. Replace the <full path to install.wim file> with the correct path by right-clicking and choosing Paste or just by typing the path.
In this example, the full command would be reagentc /setosimage /path C:\winstall\install.wim /index 1
If your path to install.wim file contains spaces, you must enclose it in double quotes: for example, reagentc /setosimage /path "F:\Windows installation folder\install.wim" /index 1
Retry the Recovery Drive creation and the Copy contents from the recovery partition to the recovery drive checkbox should now be usable. Please be aware that Recovery Drive size requirements will grow by the size of the install.wim file: instead of the default 256 megabytes, at least 4 gigabytes of space is needed now in Windows 8 and 8.1; in Windows 10, the space requirements will not change from 4 or more GB.
If you still receive errors about missing files during Refresh or Reset your PC in Windows 8, 8.1 or 10
Sometimes, even restoring the whole Windows RE partition does not make Windows 8 or 8.1 happy. In such cases, you need to create a new Custom Recovery Image; or, if you already have one, register the image again in an elevated Command Prompt window. Windows 10 does not support this method, but please continue reading.
After this, Refresh Your PC and Reset Your PC should work flawlessly in Windows 8 and 8.1.
If this does not help or your device runs Windows 10, please see the Fix Windows Update error 80070003 like a boss tutorial's second solution that helps in repairing mismatching partition ID-s.