From Deploy Windows RE | Microsoft Learn
Use the GPT attributes: 0x8000000000000001 to hide the drive letters and to mark them as required, by using a combination of two attributes: GPT_BASIC_DATA_ATTRIBUTE_NO_DRIVE_LETTER and GPT_ATTRIBUTE_PLATFORM_REQUIRED.
So, let's create the partition using DiskPart.
Step 1: Create the partition and assign drive letter.
- DiskPart
- sel disk 0
- create partition primary size=1130
- format fs=NTFS quick label=WinRE
- assign letter=T
- exit
Step 2: Copy WinRE.wim and enable Windows RE
- mkdir T:\Recovery\WindowsRE
- xcopy /h C:\Windows\System32\Recovery\Winre.wim T:\Recovery\WindowsRE
- Reagentc /setreimage /path T:\Recovery\WindowsRE /target C:\Windows
- Reagentc /enable
Step 3: Mark the partition as Recovery partition *and* hide the drive from Explorer
- diskpart
- sel disk 0
- sel par 4 ##Make sure #4 is your 1130 MB WinRE partition.
- set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac override
- gpt attributes=0x8000000000000001
- lis vol
- exit