Getting Started with Windows Recovery Environment (WinRE) | Windows OS Hub (2024)

The Windows Recovery Environment (WinRE) is a minimal operating system based on the Windows Preinstallation Environment (WinPE) image that includes several tools to repair, reset, and diagnose Windows. If Windows fails to boot, the BCD boot loader will attempt to start the WinRE environment, which can automatically fix problems or provide access to recovery tools. In WinRE, you can fix the bootloader configuration, restore the OS from an image backup, roll back to a system restore point, run a command prompt, etc.

Windows RE consists of three files on a hidden Recovery Partition (in older versions of Windows, this partition was known as the System Reserved partition.)

  • winre.wim – WIM image with WinPE environment that includes additional Windows recovery tools;
  • boot.sdi – a System Deployment Image (SDI) file used to create an in-memory WinRE RAM disk;
  • ReAgent.xml — WindowsRE configuration file.

In this article, we’ll show you how to boot Windows into the Recovery environment and how to repair the WinRE if it doesn’t work.

Contents:

  • How to Boot Into the Windows Recovery Environment
  • Windows Recovery Tools in WinRE
  • Could Not Find the Recovery Environment on Windows
  • How to Enable or Disable Windows Recovery Environment (WinRE)
  • Repairing the Windows Recovery Environment (WinRE)
  • Recreate the Recovery Environment on Windows

How to Boot Into the Windows Recovery Environment

To boot your computer into the Windows Recovery, hold down Shift and click the Restart button on the Start menu.

You can also restart the computer in WinRE mode from the command prompt using the /o option of the shutdown command:

shutdown /f /r /o /t 0

There is another command to force the system to boot into the Recovery Environment the next time the computer boots:

reagentc /boottore

The recovery environment should start automatically if there are problems with the normal Windows boot process. For example, if three previous attempts to start Windows normally have failed, the computer will automatically boot into the Windows Recovery environment. This means that to boot your computer into WinRE, all you have to do is interrupt Windows boot by pressing the power button 3 times in a row.

Windows Recovery Tools in WinRE

There are several tools available in the WinRE recovery environment that will allow you to fix a variety of problems with Windows:

  • Reset this PC – allows you to reset your Windows to factory settings (personal data and files will be deleted);
  • System Restore – allows you to restore Windows from a previously created restore point;
  • System Image Recovery – full Windows recovery from a system image backup on external media;
  • Automatic Repair/Start-up Repair – Windows tries to find and fix problems automatically: the wizard can repair the Windows bootloader, BCD configuration, and MBR (Master Boot Record);
  • Uninstall Updates – allows to remove the recently installed updates (useful if Windows won’t boot after installing updates);
  • Startup Settings – allows you to select different Windows boot scenarios: boot the computer in Safe Mode, disable driver digital signature enforcement, disable the automatic Windows restart on system failure (this is the only way to see the BSOD error code on the Windows boot screen);
  • Go back to the previous version – allows you to roll back to the previous Windows version (after you have upgraded your Windows build);
  • Command Prompt – open a command prompt to manually run diagnostic and repair commands;
  • UEFI Firmware Settings – automatically open the computer’s UEFI settings the next time it boots;

If you want to run a command prompt or any other troubleshooting tool, WinRE will ask you to enter the password for a local administrator account (the credentials are checked against the local SAM database.). However, it is possible to reset the local administrator password on Windows.

In Windows 11, most of the tools in the Recovery environment are available to you without having to enter an administrator password.

You should see a command prompt X:\Windows\System32>.

From the WinRE command prompt, you can check the disk with the chkdsk, check the Windows image with DISM and sfc.exe, run regedit, bootrec, startrep (this tool allows you to find and fix problems with the registry, drivers, and partitions), run memory diagnostics with the mdsched command, etc.

To close the WinRE command prompt and return to the boot mode selection, run the command:

exit

Could Not Find the Recovery Environment on Windows

In some cases, when the recovery partition or recovery environment WIM image file is deleted/corrupted, or the ReAgent or BCD configuration is incorrectly configured, an error may occur when you try to boot into the Windows Recovery Environment:

Could not find the recovery environment.Insert your Windows installation or recovery media, and restart your PC with the media.

The reasons why the WinRE environment does not boot on the computer can vary:

  • WinRE is compliantly disabled on Windows;
  • The Boot Configuration Data Store (BCD) doesn’t contain any entries for booting in recovery mode;
  • The winre.wim (WinRE environment image) file is missing or moved;
  • Missing or invalid WinRE configuration file (ReAgent.xml).

Next, we’ll look at the main ways to repair the WinRE environment on Windows 10 and 11.

How to Enable or Disable Windows Recovery Environment (WinRE)

You can check whether Windows Recovery Environment is enabled on your computer:

reagentc /info

The command displays the current configuration of the Windows Recovery Environment. In this example, WinRE is enabled:

Windows RE status: Enabled

This command also returns the WinRE entry identifier in the BCD (Boot Configuration Data (BCD) identifier) and the path to the Windows RE image (location: \\?\GLOBALROOT\device\harddisk0\partition4\Recovery\WindowsRE).

To activate/disable the recovery environment in Windows, use the following commands:

reagentc /disable
reagentc /enable

Windows Recovery Environment logs are stored in a file %WINDIR%\System32\LogFiles\Srt\SrtTrail.txt.

To move WinRE from the recovery partition to the system drive, check the post Cannot extend volume in Windows.

Repairing the Windows Recovery Environment (WinRE)

The simplest way to repair the Windows recovery environment configuration is to disable and enable WinRE:

reagentc /disable
reagentc /enable

The reagentc should update the BCD boot loader configuration and add entries for the WinRE environment.

If you have converted a hard disk partition table from MBR to GPT using the MBR2GPT tool, you may encounter the error:

MBR2GPT: Failed to update ReAgent.xml, please try to manually disable and enable WinRE.

To fix this, you need to reboot and manually disable and enable WinRE.

If you receive the error “REAGENTC.EXE: Unable to update Boot Configuration Data“, first fix the problem with the Windows bootloader (instructions for UEFI and BIOS computers).

The reagent command may return an error:

REAGENTC.EXE: The Windows RE image was not found.

This usually means that the winre.wim file is missing or the System Restore partition has been deleted. If this is the case, you will need to try to repair the WinRE environment.

Check that the Boot Configuration Data (BCD) configuration has the correct entries to boot the WinRE environment:

bcdedit /enum all

In the list of boot options, find the Windows Boot Loader section, with identifier={current}. This entry looks like this in our example:

Windows Boot Loader-------------------identifier {current}device partition=C:path \Windows\system32\winload.exedescription Windows 10locale en-USinherit {bootloadersettings}recoverysequence {7c817935-e52f-11e6-9c2c-0050569efccb}recoveryenabled Yesallowedinmemorysettings 0x15000075osdevice partition=C:systemroot \Windowsresumeobject {1c7df7a0-4560-11e5-9675-8451eaa913bb}nx OptInbootmenupolicy Standard

Find and remember the GUID value of the recoverysequence attribute. For example, it is {7c817935-e52f-11e6-9c2c-0050569efccb}.

Then you need to find the boot configuration section with the identifier value equal to the GUID value obtained earlier and with the Windows Recovery Environment in the description field. This entry can look like this:

Windows Boot Loader-------------------identifier {7c817935-e52f-11e6-9c2c-0050569efccb}device ramdisk=\Device\HarddiskVolume4\WindowsRE\Winre.wim,{7c817936-e52f-11e6-9c2c-0050569efccb}path \windows\system32\winload.exedescription Windows Recovery Environmentlocale en-USinherit {bootloadersettings}displaymessage Recoveryosdevice ramdisk=\Device\HarddiskVolume4\Recovery\WindowsRE\Winre.wim,{7c817936-e52f-11e6-9c2c-0050569efccb}systemroot \windowsnx OptInbootmenupolicy Standardwinpe Yes

The full path to the recovery environment WIM image is given in the Device line. In this example, it is located on hard disk partition 4 (HarddiskVolume4) at the path \Recovery\WindowsRE\Winre.wim.

To forcefully set the path to the WIM image on this partition in the WinRE configuration, run the command:

REAGENTC.EXE /setreimage /path \\?\GLOBALROOT\device\harddisk\partition4\Recovery\WindowsRE

If this partition exists, you can bind this boot loader entry to boot WinRe as the recovery environment for the current OS image.

Copy the GUID of the found entry and use it in the following command:

bcdedit /set {current} recoverysequence {FoundGUID}

Note. If you are using a multi-boot configuration, remember that each operating system adds its own Windows Recovery Environment entry to the Microsoft Boot Manager. It is important not to get confused here.

Make sure that the Winre.wim file is located in the specified path. It is usually stored in one of the following locations (folders are hidden)

  • C:\Windows\System32\Recovery;
  • On a separate, hidden Recovery Partition (or Reserved Partition);
  • On the manufacturer’s OEM recovery partition.

Then check the path to the wim file that is specified in the ReAgent.xml file (which is located in the C:\Windows\System32\Recovery directory or in the Recovery directory on the recovery partition).

notepad c:\Windows\System32\Recovery\ReAgent.xml

Open the configuration file with any editor and check the value of the <WinreLocation path = attribute. If the specified path is not available (the original partition has been deleted), you can change the path to <ImageLocation path= “\Recovery\WindowsRE”), create the C:\Recovery\WindowsRE directory, and copy the Winre.wim file into it.

Then disable and re-enable WinRE:

reagentc /disable

reagentc /enable

Recreate the Recovery Environment on Windows

If you cannot find winre.wim in any of the default directories, try searching for it using a file manager or with the following command

dir /a /s c:\winre.wim

Tip. Remember to look for this file on the hidden partitions, to which you must first assign a drive letter.

If you find the file, copy it to the default location using the commands:

attrib -h -s c:\Recovery\xxxxxxx\winre.wim
xcopy /h c:\Recovery\xxxxxxx\winre.wim c:\Windows\System32\Recovery

If you do not have a WinRE WIM image on the disc, you can copy the file from a computer with a similar version of Windows (OS version and bitness must match), or from a Windows installation media (for example, bootable USB flash drive with Windows or ISO image).

In this example, the Windows installation ISO image is used as the source of the WinRE files.

Open the ISO image using 7-Zip, select the \sources\install.wim (or install.esd) file and extract the \Windows\System32\Recovery\Winre.wim and ReAgent.xml files to C:\Windows\System32\Recovery folder. Then copy the original boot.sdi file from the \Windows\Boot\DVD folder.

You can replace the default winre.wim image with an advanced DaRT 10 recovery image which contains additional tools that can help you diagnose and fix Windows problems.

Delete the ReAgent.xml file that contains the old WinRE configurations:

ren C:\Windows\System32\Recovery\ReAgent.xml ReAgent_backup.xml

Replace the path to the winre.wim file in the Recovery Agent configuration:

reagentc /setreimage /path C:\windows\system32\recovery

REAGENTC.EXE: Operation Successful.

The command will return an error if the winre.wim file does not exist in the destination directory:

REAGENTC.EXE: No valid image found in the specified path.

It remains to enable the Windows Recovery Agent with the command:

reagentc /enable
In this case, the Windows recovery environment files are stored on the system drive C:.

Getting Started with Windows Recovery Environment (WinRE) | Windows OS Hub (2024)

References

Top Articles
Latest Posts
Article information

Author: Prof. An Powlowski

Last Updated:

Views: 5946

Rating: 4.3 / 5 (64 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Prof. An Powlowski

Birthday: 1992-09-29

Address: Apt. 994 8891 Orval Hill, Brittnyburgh, AZ 41023-0398

Phone: +26417467956738

Job: District Marketing Strategist

Hobby: Embroidery, Bodybuilding, Motor sports, Amateur radio, Wood carving, Whittling, Air sports

Introduction: My name is Prof. An Powlowski, I am a charming, helpful, attractive, good, graceful, thoughtful, vast person who loves writing and wants to share my knowledge and understanding with you.