Windows OS Hub
  • Windows Server
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Group Policies
  • Windows Clients
    • Windows 10
    • Windows 8
    • Windows 7
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
  • PowerShell
  • Exchange
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Group Policies
  • Windows Clients
    • Windows 10
    • Windows 8
    • Windows 7
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
  • PowerShell
  • Exchange

 Windows OS Hub / Windows 10 / Restoring Windows Recovery Environment (WinRE) in Windows 10

April 26, 2017 Windows 10

Restoring Windows Recovery Environment (WinRE) in Windows 10

Windows Recovery Environment (WinRE) is the minimal OS based on Windows Preinstallation Environment (WinPE) which includes a number of tools to recover, reset and diagnose Windows. If the main OS doesn’t boot on some reason, the computer tries to run WinRE, which may help to resolve the issues manually or automatically.

In some cases, the computer can’t  boot into the Windows Recovery Environment due to different problems. In this article, we’ll consider main ways of how to restore WinRE in Windows 10. The procedure is the same in Windows 7 and Windows 8.1, as well.

Contents:
  • How to Enable and Disable WinRE
  • How to Make Sure If There Are WinRE Entries in the BCD Configuration File
  • The location of the Winre.wim file
  • How to Reset Current Settings in ReAgent.xml
  • Manual Search and Recovery Winre.wim file

The reasons why WinRE environment stops loading or does not work correctly can be different:

  • WinRE is disabled in Windows settings
  • The boot configuration store (BCD) doesn’t contain entries to boot in recovery mode
  • The file winre.wim (WinRE environment image) is missing or moved
  • The WinRE configuration file ReAgent.xml is missing or contains incorrect data

Windows Recovery Environment (WinRE)

How to Enable and Disable WinRE

Try to disable and enable WinRE mode by running the following commands in the command prompt with the administrator privileges:
reagentc /disable
reagentc /enable

reagentc /enable

How to Make Sure If There Are WinRE Entries in the BCD Configuration File

Make sure that there are correct entries to boot WinRE in BCD (Boot Configuration Data) file.

Note. If WinRE has been successfully enabled using reagent, the correct WinRE entries should automatically appear in boot configuration. However, you’d better check the value of recoverysequence parameter.

Display the current BCD entries:

bcdedit /enum all

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

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 recoverysequence attribute . In our example it is {7c817935-e52f-11e6-9c2c-0050569efccb}

bcdedit /enum /all

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

Windows Boot Loader
-------------------
identifier              {7c817935-e52f-11e6-9c2c-0050569efccb}
device                  ramdisk=[F:]\Recovery\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=[F:]\Recovery\WindowsRE\Winre.wim,{7c817936-e52f-11e6-9c2c-0050569efccb}
systemroot              \windows
nx                      OptIn
bootmenupolicy          Standard
winpe                   Yes

Windows Boot Loader identifier

If you cannot find this entry, look for another BCD record with another GUID as an identifier and the text Windows Recovery Environment in the description field, which contains the path to Winre.wim in the values device and osdevice.

The path to WIM file can point to another drive (for example, [\Device\HarddiskVolume2]). If such section has been found, you can link this entry to boot WinRE as the recovery environment for the current system. Copy the GUID of the found entry and specify it using:

bcdedit /set {current} recoverysequence {FoundGUID}

Note. If you are using multiboot, keep in mind that each OS adds its own Windows Recovery Environment entry  to the Microsoft Boot Manager. It is important not to get lost in them.

The location of the Winre.wim file

Make sure that Winre.wim is present in the specified location. As a rule, it is stored in one of the following locations:

  • folder C:\Windows\System32\Recovery,
  • separate hidden partition System Reserved
  • recovery partition provided by the manufacturer.

In our example, it should be in \Recovery\WindowsRE\Winre.wim folder on drive F:\.

Also check the path specified in ReAgent.xml (located  in C:\Windows\System32\Recovery folder or in Recovery folder on the recovery partition). Open this file in any text editor and check the value of <ImageLocation path= attribute. If the path specified there doesn’t exist (the original partition has been deleted), you can change the path to <ImageLocation path=»\Recovery\WindowsRE»), create the folder C:\Recovery\WindowsRE and copy Winre.wim to it. Disable and enable WinRE again:
reagentc /disable
reagentc /enable

Tip. The current Recovery Agent configuration can be obtained using reagentc /info command. This command can help to determine the Boot Configuration Data (BCD) identifier and Windows RE path (location: \\?\GLOBALROOT\device\harddisk0\partition1\Recovery\WindowsRE)

reagent /info

How to Reset Current Settings in ReAgent.xml

If the methods described above didn’t help to recover WinRE, you can try to reset the settings in ReAgent.xml (back up this file in advance).

In Windows 8 /10, it will be enough to delete ReAgent.xml and it will be automatically created when you enable WinRE using reagentc /enable command.

In Windows 7/ Vista, open ReAgent.xml in a text editor (it’s better to use Notepad++) and clear the values of the following parameters: WinreBCD, WinreLocation, ImageLocation, InstallState, WinREStaged:

<WinreBCD id="{00000000-0000-0000-0000-000000000000}"/>
<WinreLocation path="" id="0" offset="0" guid="{00000000-0000-0000-0000-000000000000}"/>
<ImageLocation path="" id="0" offset="0" guid="{00000000-0000-0000-0000-000000000000}"/>
<InstallState state="0"/>
<WinREStaged state="0"/>

Save the changes, make sure that Winre.wim is present in the %windir%\System32\Recovery folder. Enable WinRE with the command:

reagentc /enable

Manual Search and Recovery Winre.wim file

If there is no Winre.wim in any of the standard folders, try to find it using Search feature in your file manager or using the following command:

dir /a /s c:\winre.wim

dir /a /s c:\winre.wim

Tip. Don’t forget to look for this file in the hidden partitions as well, which are to be assigned a drive letter in advance.

If you have found the file, copy it in the standard location using these commands:

attrib -h -s c:\Recovery\3b09be7c-2b1f-11e0-b06a-be7a471d71d6 \winre.wim
xcopy /h c:\Recovery\3b09be7c-2b1f-11e0-b06a-be7a471d71d6 \winre.wim c:\Windows\System32\Recovery

If you couldn’t find the file, copy it from a similar system (the OS version and bitness must coincide) or from the distribution. To do it, open \sources\install.wim on the DVD/in ISO image using 7-Zip and extract \Windows\System32\Recovery\Winre.wim to c:\Windows\System32\Recovery folder.

extracting file winre.wim from windows distribution

Change the file path in Recovery Agent configuration:

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

Now just enable Windows Recovery Agent with this command:

reagentc /enable

0 comment
0
Facebook Twitter Google + Pinterest
previous post
PowerShell Remoting via WinRM for Non-Admin Users
next post
Using WMI Filter to Apply Group Policy to IP Subnet

Related Reading

Integrating Windows Updates into Windows 10 Install Image

February 12, 2019

Copying Large Files over an Unreliable Network Using...

February 11, 2019

“The update is not applicable to your computer”:...

February 10, 2019

Fix: Clock Reverts to Wrong Time After Computer...

February 8, 2019

How to Disable Automatic Driver Updates in Windows...

February 6, 2019

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange
  • Windows 10
  • Windows 8
  • Windows 7
  • Windows Server 2016
  • Windows Server 2012 R2
  • Windows Server 2008 R2
  • PowerShell
  • VMWare
  • MS Office

Recent Posts

  • ESXi: Slow Disk Performance on HPE Gen8

    February 15, 2019
  • Integrating Windows Updates into Windows 10 Install Image

    February 12, 2019
  • Copying Large Files over an Unreliable Network Using BITS and PowerShell

    February 11, 2019
  • Fix: Clock Reverts to Wrong Time After Computer (Server) Reboot

    February 8, 2019
  • Fix: BSOD Error 0x0000007B on Boot on Windows 7 and Server 2008 R2

    February 7, 2019
  • How to Disable Automatic Driver Updates in Windows 10?

    February 6, 2019
  • WSUS Windows Update Error 0x80244010: Exceeded max server round trips

    January 31, 2019
  • Configuring SSO (Single Sign-On) Authentication on Windows Server RDS

    January 29, 2019
  • Unable to Start or Connect to Virtual Disk Service in Disk Management

    January 28, 2019
  • How to Inject Drivers into a Windows 10 WIM/ISO Install Image?

    January 15, 2019
woshub.com

Follow us

  • Facebook
  • Twitter
  • RSS
Popular Posts
  • How to Repair Broken EFI Bootloader in Windows 10, 8.1
  • How to Allow Multiple RDP Sessions in Windows 10
  • Booting Windows 7 / 10 from GPT Disk on BIOS (non-UEFI) systems
  • Removable USB Flash Drive as Local HDD in Windows 10 / 7
  • How to Restore Deleted EFI Boot Partition in Windows 10/7
  • How to increase KMS current count (count is insufficient)
  • How to Download APPX Installation File from Microsoft Store in Windows 10 / 8.1
Footer Logo

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


Back To Top