The essentials
Quick reference
One focused task per row. Jump to the related section for complete, working examples.
| Use | Syntax | Examples |
|---|---|---|
| Select the destination disk | select disk 3 | View examples |
| Inspect destination identity | detail disk | View examples |
| Erase the partition layout | clean | View examples |
| Initialize GPT | convert gpt | View examples |
| Create a 300 MB ESP | create partition efi size=300 | View examples |
| Format the ESP | format quick fs=fat32 label="System" | View examples |
| Mount the ESP in WinPE | assign letter=S | View examples |
| Create the MSR | create partition msr size=16 | View examples |
| Create the Windows partition | create partition primary | View examples |
| Reserve 1500 MB for recovery | shrink desired=1500 minimum=1500 | View examples |
| Format Windows as NTFS | format quick fs=ntfs label="Windows" | View examples |
| Mount Windows in WinPE | assign letter=W | View examples |
| Create the recovery partition | create partition primary | View examples |
| Format recovery as NTFS | format quick fs=ntfs label="Recovery" | View examples |
| Set the Windows RE type | set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac | View examples |
| Protect the recovery partition | gpt attributes=0x8000000000000001 | View examples |
| List the final partitions | list partition | View examples |
| List deployment volumes | list volume | View examples |
A Windows UEFI deployment disk uses GPT and normally contains an EFI system partition, a Microsoft reserved partition, the Windows partition, and a Windows Recovery Environment partition in that order. The complete example is intended for Windows PE and erases the selected disk. Adapt sizes to the device sector format and recovery image, verify disk identity from hardware information, and never assume the destination is disk 0.
Step by step
Detailed examples
Confirm UEFI mode, sector size, and disk identity
Use this layout only for devices that will boot Windows in UEFI mode. Windows requires GPT for UEFI installation. The EFI system partition minimum is 200 MB on 512-byte and 512e drives and 300 MB on 4Kn drives, so the example uses 300 MB. Match the destination by location path, model, serial, size, and existing layout; disk numbers can differ across otherwise identical computers.
list disk
select disk 3
detail disk
list partition
rem Stop unless firmware mode, sector format, and physical identity match the deployment record. Erase and initialize only the approved destination
Clean irreversibly removes the existing partition layout. Run this from Windows PE only after preserving data, escrowed BitLocker recovery material, and a tested redeployment path. Disconnect non-target disks when practical. Convert gpt then establishes the partition style required by UEFI Windows Setup.
select disk 3
detail disk
clean
convert gpt
list disk Create the EFI system and Microsoft reserved partitions
The EFI system partition is FAT32 and stores boot files; it is not a general data volume. The MSR is 16 MB and remains unformatted and without a drive letter. S is temporary in Windows PE. Never use X because Windows PE reserves it, and do not expect temporary letters to survive reboot.
create partition efi size=300
format quick fs=fat32 label="System"
assign letter=S
create partition msr size=16 Allocate Windows and reserve trailing recovery space
Microsoft recommends placing recovery immediately after Windows so future servicing can replace or grow it. This example creates Windows with the remaining capacity and shrinks it by 1500 MB. Current custom-layout guidance recommends at least 990 MB with at least 250 MB free; increase 1500 MB when your winre.wim, language packs, drivers, or servicing plan require more.
create partition primary
shrink desired=1500 minimum=1500
format quick fs=ntfs label="Windows"
assign letter=W Type and protect the Windows RE partition
A recovery partition is not identified by its label alone. On GPT, set the Windows recovery type GUID and attributes 0x8000000000000001. The attributes mark the partition required and prevent ordinary automatic drive-letter assignment. R is temporary for applying and configuring Windows RE; remove it after deployment if it remains assigned.
create partition primary
format quick fs=ntfs label="Recovery"
assign letter=R
set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
gpt attributes=0x8000000000000001 Verify before applying Windows images
Confirm exact order, sizes, offsets, filesystems, and temporary letters. The expected order is ESP, MSR, Windows, recovery. Apply boot and OS images only after this check. After Windows boots, verify Windows RE with reagentc and ensure the ESP and recovery partition are not exposed with ordinary drive letters.
rem WARNING: this script erases disk 3.
select disk 3
clean
convert gpt
create partition efi size=300
format quick fs=fat32 label="System"
assign letter=S
create partition msr size=16
create partition primary
shrink desired=1500 minimum=1500
format quick fs=ntfs label="Windows"
assign letter=W
create partition primary
format quick fs=ntfs label="Recovery"
assign letter=R
set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
gpt attributes=0x8000000000000001
list partition
list volume
exit Sources and further reading
References
Authoritative documentation used to verify and expand this cheat sheet.
Help us improve
Found a typo or missing example?
Tell us what would make this cheat sheet clearer, more complete, or more useful.



