locked
[SOLVED] How Do I Prepare Windows Recovery Environment on Windows 10. Taking Backup Measures on Your Windows Using ReagentC Tool and PowerShell

    General discussion

  • Howdy,

    I'm trying to enable my system with WinRE but all to no avail. What could be wrong?

    The partition layout is as follows:

    PS C:\Windows\system32> Get-Partition -DiskNumber 4
    
    
       DiskId: \\?\scsi#disk&ven_msft&prod_virtual_disk#2&2e87576f&0&000002#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
    
    PartitionNumber  DriveLetter Offset                                        Size Type
    ---------------  ----------- ------                                        ---- ----
    1                            1048576                                     500 MB Recovery
    2                            525336576                                   100 MB System
    3                            630194176                                   128 MB Reserved
    4                E           764411904                                    95 GB Basic
    5                            102769885184                               4.29 GB Recovery

    I formatted this 1st recovery partition into FAT32 and mounted the volume as R:

    PS C:\Windows\system32> Get-Partition -DiskNumber 4 -PartitionNumber 1 | Format-Volume -FileSystem FAT32 -NewFileSystemL
    abel RECOVERY -Force -Confirm:$false

    Then I created the storage folder for the Recovery Environment on this R: volume:

    PS C:\Windows\system32> mkdir "R:\Recovery\WindowsRE"
    
    
        Directory: R:\Recovery
    
    
    Mode                LastWriteTime         Length Name
    ----                -------------         ------ ----
    d-----       13.01.2015     20:15                WindowsRE


    And copied the WinRE.wim file from the storage folder on the Windows partition:

    PS C:\Windows\system32> xcopy /H E:\Windows\System32\Recovery\Winre.wim R:\Recovery\WindowsRE\
    E:\Windows\System32\Recovery\winRE.wim
    1 File(s) copied


    Finally, I attempted to enable the copied WinRE and registed it in Windows like that:

    PS C:\Windows\system32> ReAgentc.exe /setreimage /path R:\Recovery\WindowsRE\ /target E:\Windows
    Directory set to: \\?\GLOBALROOT\device\harddisk4\partition1\Recovery\WindowsRE
    
    REAGENTC.EXE: Operation Successful.

    However, checking the status with Reagent returns that WinRE is DISABLED:

    PS C:\Windows\system32> ReAgentc.exe /info /target E:\Windows
    Windows Recovery Environment (Windows RE) and system reset configuration
    Information:
    
        Windows RE status:         Disabled
        Windows RE location:
        Boot Configuration Data (BCD) identifier: 00000000-0000-0000-0000-000000000000
        Recovery image location:
        Recovery image index:      0
        Custom image location:
        Custom image index:        0
    
    REAGENTC.EXE: Operation Successful.

    And also:

    PS C:\Windows\system32> .\ReAgentc.exe /info
    Windows Recovery Environment (Windows RE) and system reset configuration
    Information:
    
        Windows RE status:         Disabled
        Windows RE location:
        Boot Configuration Data (BCD) identifier: 6a7e9cfb-700d-11e4-95e0-00155d095900
        Recovery image location:   \\?\GLOBALROOT\device\harddisk3\partition4\RecoveryImage
        Recovery image index:      4
        Custom image location:
        Custom image index:        0
    
    REAGENTC.EXE: Operation Successful.

    Why is that? What am I doing wrong here?

    How do I properly prepare OS for recovery?


    Well this is the world we live in And these are the hands we're given...





    • Changed type Exotic Hadron Thursday, February 19, 2015 6:07 PM SOLVED
    • Edited by Exotic Hadron Thursday, February 19, 2015 6:10 PM
    Tuesday, January 13, 2015 5:32 PM

All replies

  • Hi Exotic,

    If you want to boot into Windows RE in Windows 10, we could press Shift and at the same time choose Restart through the Power Option.

    Could you please explain a bit for what you want to achieve here?

    For Windows RE How-to topics, you may check the reference below:

    Windows Recovery Environment (Windows RE) How-to Topics

    Best regards


    Michael Shao
    TechNet Community Support

    Wednesday, January 14, 2015 9:49 AM
    Moderator
  • Hi Exotic,

    Apologize for the late reply.

    I have tried to create (or customize ) Windows RE in Windows 10, and the command ReAgentc.exe also returned the Windows RE as disabled, even with the enable command.

    REAgentC Command-Line Options

    Currently I am checking with the command in Windows 8.1, if any process, I will update here.

    Best regards


    Michael Shao
    TechNet Community Support

    Monday, January 19, 2015 2:14 AM
    Moderator
  • Hi Exotic,

    You may follow the steps below to re-enable WinRE in Windows 10 (works at my side):

    First you need to check if WinRE.WIM is still under C:\Windows\System32\Recovery folder. If not, mount the 9879 install.Wim using the DISM command to get the WinRE.wim:

    Mount the Wim file:

    Dism /Mount-Image /ImageFile:C:\test\images\myimage.wim /index:1 /MountDir:C:\test\offline

    Locate into(As the example here) C:\test\offline\Windows\System32\Recovery folder, then copy the Winre.wim into C:\Windows\System32\Recovery folder.

    After that, type the following command to edit the ReAgent.xml:

    Write C:\Windows\System32\Reagent.xml

    Then edit the list as showing in the picture below:

    After editing, save and close it.

    Then on the CMD window, type the following command to re-enable Windows RE:

    Reagentc /enable

    Then you could run the Reagentc /info to check Windows RE status.

    Best regards


    Michael Shao
    TechNet Community Support

    Friday, January 23, 2015 3:18 AM
    Moderator
  • Hi Michael,

    Thanks for the response! That's exactly the issue. I'll try the suggested procedure later and let you know of the result.

    Again, the issue is:

    On a UEFI machine with AHCI layout of GPT disk attempting to enable the winre.wim does not work returning  

    Windows RE status:         Disabled

    The added winre.wim shows up in the bcdedit output for the following command:

    bcdedit /enum osloader

    However, afterwards recovery entry does not show anywhere in the boot menu that appears when restarting the PC with SHIFT hold as you click Restart.

    Moreover, for unknown reason the boot menu does NOT show up at booting. No boot menu with the list of OS entries is shown after the POST test, and computer automatically boots into the {default} entry record in the BCD table. The menu timeout is set to 30 seconds.


    Well this is the world we live in And these are the hands we're given...



    Saturday, January 24, 2015 4:50 PM
  • Hi Exotic,

    What is your current situation?

    If any further help needed, please post back.

    Best regards


    Michael Shao
    TechNet Community Support

    Monday, January 26, 2015 7:47 AM
    Moderator
  • Hi Michael,

    When you write

    Write C:\Windows\System32\Reagent.xml

    Do you actually mean

    Write C:\Windows\System32\Recovery\Reagent.xml

    Second. My configuration file for Reagent looked as follows after I used ReagentC

    <?xml version='1.0' encoding='utf-8'?>
    
    <WindowsRE version="2.0">
      <WinreBCD id="{e2b0600e-6f56-11e4-82ee-abb7ebf625e8}"/>
      <WinreLocation path="\Recovery\WindowsRE" id="0" offset="102298025984" guid="{3d690d8a-98c0-4c32-aa55-ef40788e312d}"/>
      <ImageLocation path="\Recovery\WindowsRE" id="0" offset="1048576" guid="{3d690d8a-98c0-4c32-aa55-ef40788e312d}"/>
      <PBRImageLocation path="\Recovery" id="0" offset="102769885184" guid="{3d690d8a-98c0-4c32-aa55-ef40788e312d}" index="1"/>
      <PBRCustomImageLocation path="" id="0" offset="0" guid="{00000000-0000-0000-0000-000000000000}" index="0"/>
      <InstallState state="0"/>
      <OsInstallAvailable state="1"/>
      <CustomImageAvailable state="0"/>
      <IsAutoRepairOn state="1"/>
      <WinREStaged state="1"/>
      <OperationParam path=""/>
      <OsBuildVersion path="9860.0.amd64fre.fbl_release.141008-2044"/>
      <OemTool state="0"/>
      <IsServer state="0"/>
      <DownlevelWinreLocation path="" id="0" offset="0" guid="{00000000-0000-0000-0000-000000000000}"/>
      <IsWimBoot state="0"/>
      <ScheduledOperation state="5"/>
    </WindowsRE>

    However, in the newer build it looks as

    <?xml version='1.0' encoding='utf-8' standalone='yes'?>
    <WindowsRE version="2.0">
    	<WinreBCD id=""></WinreBCD>
    	<WinreLocation path="" id="0" offset="0"></WinreLocation>
    	<ImageLocation path="" id="0" offset="0"></ImageLocation>
    	<PBRImageLocation path="" id="0" offset="0" index="0"></PBRImageLocation>
    	<PBRCustomImageLocation path="" id="0" offset="0" index="0"></PBRCustomImageLocation>
    	<InstallState state="0"></InstallState>
    	<OsInstallAvailable state="0"></OsInstallAvailable>
    	<CustomImageAvailable state="0"></CustomImageAvailable>
    	<WinREStaged state="0"></WinREStaged>
    	<ScheduledOperation state="4"></ScheduledOperation>
    	<OperationParam path=""></OperationParam>
    	<OsBuildVersion path=""></OsBuildVersion>
    	<OemTool state="0"></OemTool>
    </WindowsRE>


    Look, the default formatting and usage of elements is slightly different that yours.

    Could you please copy and paste the correct XML for build 9926 provided that my WinRE.wim is located in \Recovery\WindowsRE on the 1st Recovery partition on my drive?

    What the

      <OsBuildVersion path="9860.0.amd64fre.fbl_release.141008-2044"/>


    Should look like for build 9926?

    I've finally formatted the XML file located in C:\Windows\System32\Recovery to look like:

    <?xml version='1.0' encoding='utf-8' standalone='yes'?>
    <WindowsRE version="2.0">
    	<WinreBCD id="{00000000-0000-0000-0000-000000000000}"></WinreBCD>
    	<WinreLocation path="" id="0" offset="0"></WinreLocation>
    	<ImageLocation path="" id="0" offset="0"></ImageLocation>
    	<PBRImageLocation path="" id="0" offset="0" index="0"></PBRImageLocation>
    	<PBRCustomImageLocation path="" id="0" offset="0" index="0"></PBRCustomImageLocation>
    	<InstallState state="0"></InstallState>
    	<OsInstallAvailable state="0"></OsInstallAvailable>
    	<CustomImageAvailable state="0"></CustomImageAvailable>
    	<WinREStaged state="0"></WinREStaged>
    	<ScheduledOperation state="4"></ScheduledOperation>
    	<OperationParam path=""></OperationParam>
    	<OsBuildVersion path=""></OsBuildVersion>
    	<OemTool state="0"></OemTool>
    	<IsServer state="0"></IsServer>
    	<DownlevelWinreLocation path="" id="0" offset="0" guid="{00000000-0000-0000-0000-000000000000}"/>
    	<IsWimBoot state="0"/>
    	<ScheduledOperation state="4"/>
    </WindowsRE>

    You might have forgotten the

    Dism /Unmount-Image /MountDir:C:\test\offline /discard
    command, am I right?

    Thank you.


    Well this is the world we live in And these are the hands we're given...






    Wednesday, January 28, 2015 2:46 PM
  • Hi Exotic,

    Yes, for the path, I missed the recovery folder. :)  and the unmount image.

    I will test on the new build, will update here when I finished the test.

    Best regards


    Michael Shao
    TechNet Community Support

    Thursday, January 29, 2015 4:01 AM
    Moderator
  • Hi Exotic,

    The below is the reagent.xml in clean install of Windows 10 9926:

    Next one is the result of upgrade one, I have formatted once on this, when the upgrade has finished, WindowsRE is configured with no recoveryimage again, I recreated WindowsRE and the Recovery partitions (didn't format the first partition configured by Windows setup, which always return error when doing changes on that one), then configured them using reagentc.exe:

    Best regards


    Michael Shao
    TechNet Community Support

    Monday, February 2, 2015 3:59 AM
    Moderator
  • Hi Exotic,

    The below is the reagent.xml in clean install of Windows 10 9926:

    Hi Michael,

    the default ReAgent.xml that I see right after the clean install of Windows ALREADY contains non-zero GUIDs, just like on the screenshot above.

    However, your first sample is not the same, look closely. Originally, your suggestion was to set all GUIDs to 0:

    Whichever is the correct one? Moreover XML file in .\Recovery folder within the install.WIM file and the one you find after you install Windows ARE different!

    • Do I have to zero all the GUIDs?
    • Do I need to set State 4?


    Well this is the world we live in And these are the hands we're given...


    Tuesday, February 10, 2015 5:45 PM
  • Hi Exotic,

    Yes, they are different.

    To edit the XML to all ZEROs will make Windows to Reset Windows RE settings, after you enter reagentc /enable command.

    For the State part, I reset it once and set it to 4. So the difference of it shows in the above attachments in my last reply.

    You may leave it to 5. Currently I have no idea of this parameter, and haven't got any test results on it, also no documents found out.

    Regards


    Michael Shao
    TechNet Community Support

    Wednesday, February 11, 2015 6:39 AM
    Moderator
  • Hi,

    I've managed to set Windows to look for WinRE.wim image file on the Windows partition, but I still can't manage to set Windows to look for the pre-boot environment on the first partition.

    Current output of ReagentC tool looks as:

    C:\Windows\system32>reagentc /info
    Windows Recovery Environment (Windows RE) and system reset configuration
    Information:
    
        Windows RE status:         Enabled
        Windows RE location:       \\?\GLOBALROOT\device\harddisk4\partition4\Recovery\WindowsRE
        Boot Configuration Data (BCD) identifier: e2b06019-6f56-11e4-82ee-abb7ebf625e8
        Recovery image location:   \\?\GLOBALROOT\device\harddisk4\partition5\Recovery
        Recovery image index:      1
        Custom image location:
        Custom image index:        0
    
    REAGENTC.EXE: Operation Successful.

    My disk set is:

    C:\Windows\system32>diskpart
    
    Microsoft DiskPart version 10.0.9926
    
    Copyright (C) 1999-2013 Microsoft Corporation.
    On computer: EH
    
    DISKPART> list disk
    
      Disk ###  Status         Size     Free     Dyn  Gpt
      --------  -------------  -------  -------  ---  ---
      Disk 2    Online          931 GB      0 B        *
      Disk 3    Online          930 GB      0 B        *
      Disk 4    Online          100 GB      0 B        *
    
    DISKPART>

    Partition layout is as follows:

    DISKPART> sel disk 4
    
    Disk 4 is now the selected disk.
    
    DISKPART> list part
    
      Partition ###  Type              Size     Offset
      -------------  ----------------  -------  -------
      Partition 1    Recovery           500 MB  1024 KB
      Partition 2    System             100 MB   501 MB
      Partition 3    Reserved           128 MB   601 MB
      Partition 4    Primary             95 GB   729 MB
      Partition 5    Recovery          4390 MB    95 GB
    
    DISKPART>

    According to the output of ReagentC, Windows looks for WinRE image on Partition 4. However, I need it to look for this image on Partition 1. I copied the WinRE.wim image to that partition and attempted to enable that WinRE.wim with Windows, however ReagentC returns the following:

    C:\Windows\system32>reagentc /setreimage /path \\?\Volume{A235FAFC-A690-11E4-95DC-00155D095900}\Recovery\WindowsRE /target C:\Windows
    REAGENTC.EXE: Windows RE is already enabled.

    How do change where Windows looks for WinRE?

    Sounds like WinRE.wim MUST be located on a NTFS formatted volume.

    I did the following.

    Disabled the current WinRE.wim:

    C:\Windows\system32>reagentc /disable
    REAGENTC.EXE: Operation Successful.

    Set the recovery image located on the first partition:

    C:\Windows\system32>reagentc /setreimage /path \\?\Volume{A235FAFC-A690-11E4-95DC-00155D095900}\Recovery\WindowsRE /target C:\Windows
    Directory set to: \\?\GLOBALROOT\device\harddisk4\partition1\Recovery\WindowsRE
    
    REAGENTC.EXE: Operation Successful.

    Checked the status:

    C:\Windows\system32>reagentc /info
    Windows Recovery Environment (Windows RE) and system reset configuration
    Information:
    
        Windows RE status:         Disabled
        Windows RE location:
        Boot Configuration Data (BCD) identifier: 00000000-0000-0000-0000-000000000000
        Recovery image location:   \\?\GLOBALROOT\device\harddisk4\partition5\Recovery
        Recovery image index:      1
        Custom image location:
        Custom image index:        0

    Look, WinRE disappeared from the list (the Windows RE location property is empty!). Also, note that BCD identifier has been reset to all zeroes!

    Attempted to re-enable the WinRE.wim image on the FAT32 formatted 1st partition:

    C:\Windows\system32>reagentc /enable
    REAGENTC.EXE: Windows RE must be installed on a simple volume formatted using NTFS.

    It looks to be the issue! I'll reformat the 1st partition and report back to you.

    Thank you for your help!

    See also


    Well this is the world we live in And these are the hands we're given...



    Thursday, February 19, 2015 3:47 PM
  • Okay, Michael, I figured the root cause of the problem.

    The issue is that Windows does NOT allow you to specify a non-Windows partition as the one containing WinRE.wim image. However, if the WinRE.wim is located on the Windows partition, everything goes smooth.

    Why is that? I kind of ruins the idea of recovery environment. If Windows partition gets broken, how would I run the WinRE environment?

    Would you please help to set Windows to look for WinRE on a partition other than Windows partition?

    The following procedure works well:

    1. Disable the current setup:

    C:\Windows\system32>reagentc /disable
    REAGENTC.EXE: Operation Successful.

    2. Check the status:

    C:\Windows\system32>reagentc /info
    Windows Recovery Environment (Windows RE) and system reset configuration
    Information:
    
        Windows RE status:         Disabled
        Windows RE location:
        Boot Configuration Data (BCD) identifier: 00000000-0000-0000-0000-000000000000
        Recovery image location:
        Recovery image index:      0
        Custom image location:
        Custom image index:        0
    
    REAGENTC.EXE: Operation Successful.


    3. Make sure that C:\Windows\System32\Recovery\ReAgent.xml contains zeroes in location elements.

    This is a proper config:

    <?xml version='1.0' encoding='utf-8' standalone='yes'?>
    <WindowsRE version="2.0">
    	<WinreBCD id=""></WinreBCD>
    	<WinreLocation path="" id="0" offset="0"></WinreLocation>
    	<ImageLocation path="" id="0" offset="0"></ImageLocation>
    	<PBRImageLocation path="" id="0" offset="0" index="0"></PBRImageLocation>
    	<PBRCustomImageLocation path="" id="0" offset="0" index="0"></PBRCustomImageLocation>
    	<InstallState state="0"></InstallState>
    	<OsInstallAvailable state="0"></OsInstallAvailable>
    	<CustomImageAvailable state="0"></CustomImageAvailable>
    	<WinREStaged state="0"></WinREStaged>
    	<ScheduledOperation state="4"></ScheduledOperation>
    	<OperationParam path=""></OperationParam>
    	<OsBuildVersion path=""></OsBuildVersion>
    	<OemTool state="0"></OemTool>
    </WindowsRE>


    This is an incorrect config (this one demonstrates an already configured WinRE and OS Image configurations and cannot be reused to set another locations of WinRE and OSImage:

    <?xml version='1.0' encoding='utf-8'?>
    
    <WindowsRE version="2.0">
      <WinreBCD id="{00000000-0000-0000-0000-000000000000}"/>
      <WinreLocation path="" id="0" offset="0" guid="{00000000-0000-0000-0000-000000000000}"/>
      <ImageLocation path="\Recovery\WindowsRE" id="0" offset="1048576" guid="{a235fafb-a690-11e4-95dc-00155d095900}"/>
      <PBRImageLocation path="\Recovery" id="0" offset="102769885184" guid="{a235fafb-a690-11e4-95dc-00155d095900}" index="1"/>
      <PBRCustomImageLocation path="" id="0" offset="0" guid="{00000000-0000-0000-0000-000000000000}" index="0"/>
      <InstallState state="0"/>
      <OsInstallAvailable state="1"/>
      <CustomImageAvailable state="0"/>
      <IsAutoRepairOn state="1"/>
      <WinREStaged state="1"/>
      <OperationParam path=""/>
      <OsBuildVersion path="9926.0.amd64fre.fbl_awesome1501.150119-1648"/>
      <OemTool state="0"/>
      <IsServer state="0"/>
      <DownlevelWinreLocation path="" id="0" offset="0" guid="{00000000-0000-0000-0000-000000000000}"/>
      <IsWimBoot state="0"/>
      <ScheduledOperation state="4"/>
    </WindowsRE>


    4. Set WinRE recovery environment:

    C:\Windows\system32>reagentc /setreimage /path C:\Windows\System32\Recovery /target C:\Windows
    Directory set to: \\?\GLOBALROOT\device\harddisk4\partition4\Windows\System32\Recovery
    
    REAGENTC.EXE: Operation Successful.

    5. Check the status:

    C:\Windows\system32>reagentc /info
    Windows Recovery Environment (Windows RE) and system reset configuration
    Information:
    
        Windows RE status:         Disabled
        Windows RE location:
        Boot Configuration Data (BCD) identifier: 00000000-0000-0000-0000-000000000000
        Recovery image location:
        Recovery image index:      0
        Custom image location:
        Custom image index:        0
    
    REAGENTC.EXE: Operation Successful.


    6. Enable the specified WinRE:

    C:\Windows\system32>reagentc /enable
    REAGENTC.EXE: Operation Successful.


    7. Check the status

    C:\Windows\system32>reagentc /info
    Windows Recovery Environment (Windows RE) and system reset configuration
    Information:
    
        Windows RE status:         Enabled
        Windows RE location:       \\?\GLOBALROOT\device\harddisk4\partition4\Recovery\WindowsRE
        Boot Configuration Data (BCD) identifier: e2b0601f-6f56-11e4-82ee-abb7ebf625e8
        Recovery image location:
        Recovery image index:      0
        Custom image location:
        Custom image index:        0
    
    REAGENTC.EXE: Operation Successful.


    8. Look for the location of OS Image. List available volumes:

    C:\Windows\system32>mountvol
    Creates, deletes, or lists a volume mount point.
    
    MOUNTVOL [drive:]path VolumeName
    MOUNTVOL [drive:]path /D
    MOUNTVOL [drive:]path /L
    MOUNTVOL [drive:]path /P
    MOUNTVOL /R
    MOUNTVOL /N
    MOUNTVOL /E
    MOUNTVOL drive: /S
    
        path        Specifies the existing NTFS directory where the mount
                    point will reside.
        VolumeName  Specifies the volume name that is the target of the mount
                    point.
        /D          Removes the volume mount point from the specified directory.
        /L          Lists the mounted volume name for the specified directory.
        /P          Removes the volume mount point from the specified directory,
                    dismounts the volume, and makes the volume not mountable.
                    You can make the volume mountable again by creating a volume
                    mount point.
        /R          Removes volume mount point directories and registry settings
                    for volumes that are no longer in the system.
        /N          Disables automatic mounting of new volumes.
        /E          Re-enables automatic mounting of new volumes.
        /S          Mount the EFI System Partition on the given drive.
    
    Possible values for VolumeName along with current mount points are:
    
        \\?\Volume{5cfc45df-46d3-4d5f-908b-1dc410e45f50}\
            D:\
    
        \\?\Volume{e31ab7ff-9fd7-11e4-9606-00155d095900}\
            E:\
    
        \\?\Volume{b416aa49-fbaf-4e2f-a8c4-e4a34fa0685f}\
            C:\
    
        \\?\Volume{fac28136-c10c-4793-9250-31cfe90536f7}\
            *** NO MOUNT POINTS ***
    
        \\?\Volume{a235fafc-a690-11e4-95dc-00155d095900}\
            *** NO MOUNT POINTS ***
    
        \\?\Volume{a235faff-a690-11e4-95dc-00155d095900}\
            *** NO MOUNT POINTS ***
    
        \\?\Volume{91be2ee2-a702-11e4-ab2f-806e6f6e6963}\
            F:\
    
    
    C:\Windows\system32>

    9. Press WindowKey+R and paste the location of the volume with OS Image to it then hit ENTER:

    \\?\Volume{a235faff-a690-11e4-95dc-00155d095900}\

    10. Check with Windows Explorer that this volume contains the image.wim file with Windows image copied from Windows setup DVD:

    \\?\Volume{A235FAFF-A690-11E4-95DC-00155D095900}\Recovery\install.wim

    11. Set location of the OS Image:

    C:\Windows\system32>reagentc /setosimage /path \\?\Volume{A235FAFF-A690-11E4-95DC-00155D095900}\Recovery /index 1 /targe
    t C:\Windows
    Directory set to: \\?\GLOBALROOT\device\harddisk4\partition5\Recovery
    
    REAGENTC.EXE: Operation Successful.

    12. Check the status

    C:\Windows\system32>reagentc /info
    Windows Recovery Environment (Windows RE) and system reset configuration
    Information:
    
        Windows RE status:         Enabled
        Windows RE location:       \\?\GLOBALROOT\device\harddisk4\partition4\Recovery\WindowsRE
        Boot Configuration Data (BCD) identifier: e2b0601f-6f56-11e4-82ee-abb7ebf625e8
        Recovery image location:   \\?\GLOBALROOT\device\harddisk4\partition5\Recovery
        Recovery image index:      1
        Custom image location:
        Custom image index:        0
    
    REAGENTC.EXE: Operation Successful.

    Your Windows Recovery environment is ready to use and you may now restart Windows into it by holding SHIFT pressed when you click Restart in the Start menu.


    Well this is the world we live in And these are the hands we're given...

    Thursday, February 19, 2015 4:58 PM
  • The target drive with location of WinRE.wim file MUST be NTFS formatted.

    Here's what you need to do to enable WinRE.wim that is located on another partition (Partition 1 in my case):

    1. Disable the current setup:

    C:\Windows\system32>reagentc /disable
    REAGENTC.EXE: Operation Successful.

    2. Check the status:

    C:\Windows\system32>reagentc /info
    Windows Recovery Environment (Windows RE) and system reset configuration
    Information:
    
        Windows RE status:         Disabled
        Windows RE location:
        Boot Configuration Data (BCD) identifier: 00000000-0000-0000-0000-000000000000
        Recovery image location:   \\?\GLOBALROOT\device\harddisk4\partition5\Recovery
        Recovery image index:      1
        Custom image location:
        Custom image index:        0
    
    REAGENTC.EXE: Operation Successful.

    3. Make sure that C:\Windows\System32\Recovery\ReAgent.xml contains zeroes in location elements.

    This is a proper config:

    <?xml version='1.0' encoding='utf-8' standalone='yes'?>
    <WindowsRE version="2.0">
    	<WinreBCD id=""></WinreBCD>
    	<WinreLocation path="" id="0" offset="0"></WinreLocation>
    	<ImageLocation path="" id="0" offset="0"></ImageLocation>
    	<PBRImageLocation path="" id="0" offset="0" index="0"></PBRImageLocation>
    	<PBRCustomImageLocation path="" id="0" offset="0" index="0"></PBRCustomImageLocation>
    	<InstallState state="0"></InstallState>
    	<OsInstallAvailable state="0"></OsInstallAvailable>
    	<CustomImageAvailable state="0"></CustomImageAvailable>
    	<WinREStaged state="0"></WinREStaged>
    	<ScheduledOperation state="4"></ScheduledOperation>
    	<OperationParam path=""></OperationParam>
    	<OsBuildVersion path=""></OsBuildVersion>
    	<OemTool state="0"></OemTool>
    </WindowsRE>

    This is an incorrect config (this one demonstrates an already configured WinRE and OS Image configurations and cannot be reused to set another locations of WinRE and OSImage:

    <?xml version='1.0' encoding='utf-8'?>
    
    <WindowsRE version="2.0">
      <WinreBCD id="{00000000-0000-0000-0000-000000000000}"/>
      <WinreLocation path="" id="0" offset="0" guid="{00000000-0000-0000-0000-000000000000}"/>
      <ImageLocation path="\Recovery\WindowsRE" id="0" offset="1048576" guid="{a235fafb-a690-11e4-95dc-00155d095900}"/>
      <PBRImageLocation path="\Recovery" id="0" offset="102769885184" guid="{a235fafb-a690-11e4-95dc-00155d095900}" index="1"/>
      <PBRCustomImageLocation path="" id="0" offset="0" guid="{00000000-0000-0000-0000-000000000000}" index="0"/>
      <InstallState state="0"/>
      <OsInstallAvailable state="1"/>
      <CustomImageAvailable state="0"/>
      <IsAutoRepairOn state="1"/>
      <WinREStaged state="1"/>
      <OperationParam path=""/>
      <OsBuildVersion path="9926.0.amd64fre.fbl_awesome1501.150119-1648"/>
      <OemTool state="0"/>
      <IsServer state="0"/>
      <DownlevelWinreLocation path="" id="0" offset="0" guid="{00000000-0000-0000-0000-000000000000}"/>
      <IsWimBoot state="0"/>
      <ScheduledOperation state="4"/>
    </WindowsRE>

    4. Assign a drive letter to Partition 1.

    C:\Windows\system32>diskpart
    
    Microsoft DiskPart version 10.0.9926
    
    Copyright (C) 1999-2013 Microsoft Corporation.
    On computer: EH
    
    DISKPART> list disk
    
      Disk ###  Status         Size     Free     Dyn  Gpt
      --------  -------------  -------  -------  ---  ---
      Disk 2    Online          931 GB      0 B        *
      Disk 3    Online          930 GB      0 B        *
      Disk 4    Online          100 GB      0 B        *
    
    DISKPART> sel disk 4
    
    Disk 4 is now the selected disk.
    
    DISKPART> list part
    
      Partition ###  Type              Size     Offset
      -------------  ----------------  -------  -------
      Partition 1    Recovery           500 MB  1024 KB
      Partition 2    System             100 MB   501 MB
      Partition 3    Reserved           128 MB   601 MB
      Partition 4    Primary             95 GB   729 MB
      Partition 5    Recovery          4390 MB    95 GB
    
    DISKPART> sel part 1
    
    Partition 1 is now the selected partition.
    
    DISKPART> assign letter="R"
    
    DiskPart successfully assigned the drive letter or mount point.

    5. Remove existing Recovery folders on R:

    R:\>rd Recovery /q /s

    6. Prepare folder structure:

    R:\>mkdir Recovery
    
    R:\>mkdir Recovery\WindowsRE

    7. Copy WinRE.wim image to WindowsRE:

    R:\>xcopy /H C:\Windows\System32\Recovery\Winre.wim R:\Recovery\WindowsRE\
    C:\Windows\System32\Recovery\Winre.wim
    1 File(s) copied

    8. Copy config file:

    R:\>xcopy /H C:\Windows\System32\Recovery\ReAgent.xml R:\Recovery\WindowsRE
    C:\Windows\System32\Recovery\ReAgent.xml
    1 File(s) copied

    4. Set WinRE recovery environment:

    R:\>reagentc /setreimage /path R:\Recovery\WindowsRE /target C:\Windows
    Directory set to: \\?\GLOBALROOT\device\harddisk4\partition1\Recovery\WindowsRE
    
    REAGENTC.EXE: Operation Successful.


    5. Check the status:

    C:\Windows\system32>reagentc /info
    Windows Recovery Environment (Windows RE) and system reset configuration
    Information:
    
        Windows RE status:         Disabled
        Windows RE location:
        Boot Configuration Data (BCD) identifier: 00000000-0000-0000-0000-000000000000
        Recovery image location:
        Recovery image index:      0
        Custom image location:
        Custom image index:        0
    
    REAGENTC.EXE: Operation Successful.

    6. Enable the specified WinRE:

    Here's what you'll get if your target partition (with volume labeled R: in this example) is not formatted in NTFS:

    R:\>reagentc /enable
    REAGENTC.EXE: Windows RE must be installed on a simple volume formatted using NTFS.

    That's what you'll get if it is formatted into NTFS:

    R:\>reagentc /enable
    REAGENTC.EXE: Operation Successful.

    7. Check the status:

    R:\>reagentc /info
    Windows Recovery Environment (Windows RE) and system reset configuration
    Information:
    
        Windows RE status:         Enabled
        Windows RE location:       \\?\GLOBALROOT\device\harddisk4\partition1\Recovery\WindowsRE
        Boot Configuration Data (BCD) identifier: e2b06021-6f56-11e4-82ee-abb7ebf625e8
        Recovery image location:
        Recovery image index:      0
        Custom image location:
        Custom image index:        0
    
    REAGENTC.EXE: Operation Successful.


    Your Windows setup has just been enabled with WinRE pre-boot recovery environment located on the first partition of your drive:

    8. Specify location of OS Image file (the install.wim one copied from Windows Setup DVD):

    R:\>reagentc /setosimage /path \\?\Volume{A235FAFF-A690-11E4-95DC-00155D095900}\Recovery /index 1 /target C:\Windows
    Directory set to: \\?\GLOBALROOT\device\harddisk4\partition5\Recovery
    
    REAGENTC.EXE: Operation Successful.

    9. Check the status:

    R:\>reagentc /info
    Windows Recovery Environment (Windows RE) and system reset configuration
    Information:
    
        Windows RE status:         Enabled
        Windows RE location:       \\?\GLOBALROOT\device\harddisk4\partition1\Recovery\WindowsRE
        Boot Configuration Data (BCD) identifier: e2b06021-6f56-11e4-82ee-abb7ebf625e8
        Recovery image location:   \\?\GLOBALROOT\device\harddisk4\partition5\Recovery
        Recovery image index:      1
        Custom image location:
        Custom image index:        0
    
    REAGENTC.EXE: Operation Successful.

    Your Windows Recovery Environment is now located on the 1st partition of 4th disk drive and recovery image file the can be used to re-image Windows installation from that WinRE environment is located on the 5th partition of the same 4th disk.

    See also

    1. Configuring Windows Recovery Using PowerShell
    2. Proper Configuration of Partition Layout on a GPT Disk under UEFI
    3. Deploy a System Recovery Image

    Thank you, Michael for your help!



    Well this is the world we live in And these are the hands we're given...



    Thursday, February 19, 2015 5:10 PM
  • Hi Exotic,

    Well, it seems to be a long journey.

    Glad to see it works at last. I have done some tests that shows the WinRE status is disabled after I formatted the first WinRE NTFS partition. Even reconfigured the above steps. Reopen the CMD, and type reagentc /info, disabled again. Really annoying. Which makes me thought that the volume info of the first partition might be erased from the prior NTFS system, which is configured automatically by Windows Setup.

    One more thing I would like to remind is you need to set the partition to be recongnized as recovery partition, which means , we need to set the partition GUID to be recognized as Windows Recovery partition (When configuring this partition), (See here for reference: CREATE_PARTITION_PARAMETERS structure ):

    Select volume 2 (Assume this is your partition 1);

    Set id= de94bba4-06d1-4d40-a16a-bfd50179d6ac

    By the way, glad I can help here.

    Best regards


    Michael Shao
    TechNet Community Support


    Saturday, February 21, 2015 6:20 AM
    Moderator