Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Windows 10 / Getting Started with Windows Recovery Environment (WinRE)

July 7, 2023 Windows 10Windows 11Windows Server 2016

Getting Started with Windows Recovery Environment (WinRE)

The Windows Recovery Environment (WinRE) is a minimal operating system based on the Windows Preinstallation Environment (WinPE) image that includes a number of 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.

windows recovery environment files on system reserved partition (winre.wim, boot.sdi, ReAgent.xml) )

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.

force boot into winre from windows 10

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

shutdown -o (parameter to boot into winre)

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 a number of 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); winre: automatic repair tool in windows10
  • 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;

winre tools

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.

login windows recovery environment local administrator credentials

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.

winre command prompt startrep.exe

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.

Could not find the recovery environment windows 10

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

reagentc /info: check winre state in windows

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).

In order 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.

reagentc /enable

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.

REAGENT.EXE: The Windows RE image was not found

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.exe
description             Windows 10
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {7c817935-e52f-11e6-9c2c-0050569efccb}
recoveryenabled         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \Windows
resumeobject            {1c7df7a0-4560-11e5-9675-8451eaa913bb}
nx                      OptIn
bootmenupolicy          Standard

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

windowsre bcd entry

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.exe
description             Windows Recovery Environment
locale                  en-US
inherit                 {bootloadersettings}
displaymessage          Recovery
osdevice                ramdisk=\Device\HarddiskVolume4\Recovery\WindowsRE\Winre.wim,{7c817936-e52f-11e6-9c2c-0050569efccb}
systemroot              \windows
nx                      OptIn
bootmenupolicy          Standard
winpe                   Yes

Windows Boot Loader identifier

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 (make sure you haven’t deleted the 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.

reagent.xml - Windows RE config file

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

dir /a /s c:\winre.wim

Tip. Remember to look for this file on the hidden partitions, 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.

extracting file winre.wim from windows distribution

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:.

11 comments
5
Facebook Twitter Google + Pinterest
previous post
How to Backup and Copy Local Group Policy Settings to Another Computer
next post
Configuring Azure AD Password Policy

Related Reading

Zabbix: How to Get Data from PowerShell Scripts

October 27, 2023

Tracking Printer Usage with Windows Event Viewer Logs

October 19, 2023

How to Use Ansible to Manage Windows Machines

September 25, 2023

Installing Language Pack in Windows 10/11 with PowerShell

September 15, 2023

How to View and Change BIOS (UEFI) Settings...

September 13, 2023

11 comments

BingLi224 March 14, 2020 - 11:11 am

Hi. Thanks for instructions.

I’ve got the error in last command:

REAGENTC.EXE: Operation failed: 3bc3

REAGENTC.EXE: An error has occurred.

Reply
Paul March 29, 2020 - 9:53 am

Thanks a lot,

I went through this guide until this already was my fix:
bcdedit /set {current} recoverysequence {FoundGUID}

so systematic, wunderful !!!

Reply
Musaddiq May 20, 2020 - 7:20 am

Thank you Sooooo Much Dear………..

Reply
BOB July 2, 2020 - 8:13 pm

Why is it so %^*#@ hard to recover any Windows system??? It seems like you have to be a PC expert to navigate all the tricks, parameters, special programs and keystrokes needed just to start the process — not to mention the fact that sometimes you have to wait for hours while some file performs a check or repair without any clues as to what it’s actually doing.

Reply
Camo October 24, 2020 - 12:58 am

For me I have recovery set up perfectly fine yet when I try to enable reagentc it spits out Error 2 and tells me I have missing BCD data which is totally false. Bcdedit /enum all shows recoveryenabled yes and all GUID’s are in place. I really dislike Windows sometimes…

Reply
Rolf May 3, 2021 - 12:26 pm

I recommend also to mention that you can set up a new BCD from WinRE, if the BCD partition has gone haywire. I use:
Diskpart
/ List Disk / List Volume / Select volume / Assign Letter=z: (z: is an example)
exit Diskpart and then
BCDBOOT h:\Windows /S z: /F uefi /v /vbcd
Small drive letters need replacing with current system’s values and maybe choose MBR instead of UEFI

Reply
Marco* August 8, 2021 - 12:58 am

WinRE Was NOT able to fix My issue using the ‘repair startup’ options. I have a “corrupt or missing winload.EFI x00000f thingy error @#$%! Started right after I “attempted” to install windows 7 on the a dual boot with existing windows 10. EZ-PZ RIGHT? NOT!!!
it doesn’t like ANY of my five Win7 ISO files #$%@ I HATE WINDOWS 10!! I’m about to wipe it and just install windows 7.
SO, brand new 1 week, I just hit reset PC and hopefully that will fix the EFI problem.
Sure, I was an L1 Windows 98 tech specialist – but I did not know about the windows 10 RE feature thanks! See you can teach an old dog new tricks – here boy!

Reply
Manuel September 30, 2021 - 4:28 pm

Repaired WinRe using only the REAGENTC command

REAGENTC.EXE /setreimage /path \\?\GLOBALROOT\device\harddisk3\partition5\Recovery\WindowsRE
REAGENTC.EXE /enable

/Info Before:
Informazioni di configurazione per Ambiente ripristino Windows
e la reimpostazione del sistema:

Stato Ambiente ripristino Windows: Disabled
Percorso Ambiente ripristino Windows:
Identificatore dati di configurazione di avvio (BCD): df2795b6-bc86-11eb-a4ee-f18045c7c806
Percorso immagine di ripristino:
Indice immagine di ripristino: 0
Percorso immagine personalizzata:
Indice immagine personalizzata: 0

REAGENTC.EXE: operazione riuscita.

/info After:
Informazioni di configurazione per Ambiente ripristino Windows
e la reimpostazione del sistema:

Stato Ambiente ripristino Windows: Enabled
Percorso Ambiente ripristino Windows: \\?\GLOBALROOT\device\harddisk3\partition5\Recovery\WindowsRE
Identificatore dati di configurazione di avvio (BCD): b229eba4-2206-11ec-9332-9c5c8ebce330
Percorso immagine di ripristino:
Indice immagine di ripristino: 0
Percorso immagine personalizzata:
Indice immagine personalizzata: 0

REAGENTC.EXE: operazione riuscita.

Reply
Kry October 21, 2021 - 8:13 pm

Hi, thx for infos so much.

Reply
Elton February 14, 2022 - 12:49 am

thank-you.. my windows 10 is having issues.. I tried to use media creation tool to do an in-place installation, but that gave this error “sorry we’re having trouble determining if your pc can run windows 10” (even though the pc is ALREADY running windows 10)..

using Everything search (a program) I was able to locate the winre.wim and made the folder you mentioned myself and copied the file inside and ran your 2 recovery commands after…
After that the Recovery Drive creation seems to say “please wait” a bit longer than usual… really would be nice if they told more information to be honest..

Anyways my msconfig currently is not showing any bootable drives.. I have a UEFI drive.. so not sure how to fix the boot.. my pc boots up.. but very slow I have a feeling the boot stuff is messed up or failling hard drive

Reply
Francesco February 10, 2023 - 10:46 am

Thanks, your articles are so useful! Learning a lot from them. Invaluable well done job.

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023
  • How to Use Ansible to Manage Windows Machines

    September 25, 2023
  • Installing Language Pack in Windows 10/11 with PowerShell

    September 15, 2023
  • Configure Email Forwarding for Mailbox on Exchange Server/Microsoft 365

    September 14, 2023
  • How to View and Change BIOS (UEFI) Settings with PowerShell

    September 13, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • How to Allow Multiple RDP Sessions on Windows 10 and 11
  • How to Repair EFI/GPT Bootloader on Windows 10 or 11
  • How to Restore Deleted EFI System Partition in Windows
  • Network Computers are not Showing Up in Windows 10/11
  • How to Run Program without Admin Privileges and Bypass UAC Prompt
  • Fix: BSOD Error 0x0000007B (INACCESSABLE_BOOT_DEVICE) on Windows
  • Fixing ‘The Network Path Was Not Found’ 0x80070035 Error Code on Windows
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top