This guide covers how to use Diskpart to prepare your drive during a clean Windows 10 installation. Prerequisites A Windows 10 installation USB drive.
Use this if the drive has messy partitions or you want a fresh start. list disk (Shows all connected drives) select disk X (Replace X with your drive number, usually 0) clean (Wipes the partition table) 2. Convert to GPT (For UEFI/Modern BIOS)
Write-Host " nRunning diskpart..." -ForegroundColor Cyan Start-Process "diskpart.exe" -ArgumentList "/s "$scriptPath`"" -Wait -NoNewWindow diskpart windows 10 install
clean : Wipes all partition and volume formatting from the selected disk, leaving it as unallocated space.
Follow these commands exactly. Typos can be dangerous, so double-check before hitting Enter. This guide covers how to use Diskpart to
First, use diskpart and list volume to identify the drive letters of your EFI system partition (usually FAT32, around 100-500 MB) and your main Windows partition (usually NTFS, the largest one). The EFI partition often does not have a drive letter assigned. You can assign one with select volume X , then assign letter="S" . Now, use the following commands in the Command Prompt:
select disk 0
Type:
If you see an error saying the disk is MBR but the system requires GPT: list disk select disk X clean convert gpt If your hardware is older and doesn't support UEFI: list disk select disk X clean convert mbr 4. Create a Manual Partition If you want to define the exact size of your C: drive: list disk (Shows all connected drives) select disk
You can extend this script to: