Setting WinRE (Windows Recovery Environment) Flag On Partitions

In AOMEI Partition Assistant I have cloned multiple partitions of one hard drive to another, however, the WRE flags have not been carried over, even when MSR and EFI have.

Is there any way to set WRE flags or is this even something that would have any effect on using WRE on the laptop the cloned HD will later be connected to?

Thanks in advance!


  • Run diskpart
  • Make sure of the correct disk number by running list disk command.
  • Run select disk X where X is the number of cloned disk.
  • Make sure of the correct WinRE partition(s) number by running list partition command.
  • select partition Y where Y is the number of WinRE partition.
  • Run set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac" to set Recovery Flag on the partition.

    (Optional): to provide more protection on partition Run gpt attributes=0x8000000000000001. This attribute is cumulative and the sum of 0x0000000000000001 (set as required partition by system) and 0x8000000000000000 (prevent assigning drive letter automatically on new machines).

  • Repeat last 2 steps for each of the additional WinRE partitions.

Note: Just for your consideration, you can also do this on MBR disks by running set id=27.

Update:

If you've accidentally set Recovery Partition ID (or any other ID) on a partition by mistake, to convert it to a normal partition again:

On an MBR Disk:

select disk X
select partition Y
set id=7

On a GPT Disk:

select disk X
select partition Y
set id="ebd0a0a2-b9e5-4433-87c0-68b6b72699c7"

Where 0x07 and ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 are partition type IDs for normal partitions respectively on MBR and GPT disks. (You can find it as the first item in the last link called PARTITION_BASIC_DATA_GUID. also for MBR see 3rd link).

Sources:

MBR Disks (BIOS installation):

  • Configure BIOS/MBR-Based Hard Drive Partitions

  • Sample: Configure BIOS/MBR-Based Hard Disk Partitions by Using Windows PE and DiskPart

  • MBR Partition Type ID

GPT Disks (UEFI installation):

  • Configure UEFI/GPT-Based Hard Drive Partitions

  • Sample: Configure UEFI/GPT-Based Hard Drive Partitions by Using Windows PE and DiskPart

  • GPT Partition ID and Attributes