Fixed | Diskpart Windows 10 Install
The installation of Windows 10 is usually a smooth ride—until you hit the dreaded "Windows cannot be installed to this disk" error. This is where Diskpart, the command-line utility for disk partitioning, becomes the hero of the story. The Setup: When the GUI Fails
Imagine you've booted your PC from a Windows 10 USB installation drive. You reach the "Where do you want to install Windows?" screen, but the "Next" button is greyed out. Maybe the drive has an incompatible partition style (MBR vs. GPT) or a stubborn, invisible partition. The Turning Point: Summoning the Command Prompt
To bypass the limitation, you don't need a new hard drive; you just need to talk to the hardware directly.
Shift + F10: At the installation screen, pressing this keyboard shortcut instantly pulls up the black Command Prompt window—a secret gateway for advanced users.
diskpart: Typing this command and hitting Enter launches the utility. The prompt changes to DISKPART>, signaling you now have direct control over your storage. The Resolution: Cleaning the Slate
The objective is to wipe the drive and prepare it for a fresh Windows installation.
list disk: You see a list of every drive connected. "Disk 0" is usually your main hard drive. diskpart windows 10 install
select disk 0: You tell the computer exactly which drive to focus on.
clean: This is the "nuclear" option. It wipes every partition and hidden file from the selected disk, leaving it completely unallocated and ready for a fresh start. The Finale: A Successful Install
With the drive now "clean," you can either manually create a partition using create partition primary or simply type exit, close the command window, and hit "Refresh" on the installation screen. The "Next" button suddenly lights up, the error is gone, and Windows 10 begins its final installation journey.
How to use the Diskpart Utility preparing to install Windows - Micro Center
5. Partition Style Conversion (MBR vs. GPT)
The most common use case for DiskPart during installation is resolving the MBR/GPT mismatch. The partition style must match the boot mode.
Save and run diskpart
$scriptPath = "$env:TEMP\diskpart_win10.txt" $diskpartScript | Out-File -FilePath $scriptPath -Encoding ascii The installation of Windows 10 is usually a
Write-Host "nRunning diskpart..." -ForegroundColor Cyan Start-Process "diskpart.exe" -ArgumentList "/s "$scriptPath`"" -Wait -NoNewWindow
Write-Host "`n✅ Disk $diskNumber prepared successfully!" -ForegroundColor Green Write-Host " EFI partition: S: (FAT32)" Write-Host " Windows partition: W: (NTFS)"
4. Clean the Drive
This command removes any and all partition tables from the drive. This deletes everything on the selected drive.
clean
If successful, you will see: "DiskPart succeeded in cleaning the disk."
Quick command summary
Replace N with disk number, adjust sizes/letters as needed.
- List disks:
diskpart list disk select disk N clean convert gpt create partition efi size=100 format quick fs=fat32 label="System" assign letter=S create partition primary format quick fs=ntfs label="Windows" assign letter=W exit - For MBR:
select disk N clean convert mbr create partition primary format quick fs=ntfs label="Windows" assign letter=W active exit
This prepares the drive for a clean Windows 10 install. adjust sizes/letters as needed.
during a Windows 10 installation is the best way to bypass drive errors, fix partition table mismatches (MBR vs. GPT), or "deep clean" a drive before a fresh start. 🛠️ Step 1: Open the Command Prompt
You can access the command line directly from the Windows Setup screen without needing to boot into an existing OS. Boot from your Windows 10 Installation Media (USB or DVD). Stop at the "Install Now" screen (where you select your language). Shift + F10 on your keyboard. A black Command Prompt window will appear. 💻 Step 2: The DiskPart Sequence Follow these commands exactly. Be careful:
command permanently erases everything on the selected drive. Anson VanDoren Launches the disk utility. Shows all connected drives. select disk X with your drive number (usually Wipes the drive's partition table. convert gpt Recommended for modern UEFI systems. Closes DiskPart. 📀 Step 3: Complete the Installation
Once you have cleaned the disk and converted it, you don't actually need to create partitions manually via command line. Close the Command Prompt window. Return to the Windows Setup wizard and click "Install Now." "Custom: Install Windows only (advanced)." You will see your drive listed as "Unallocated Space." Select that space and click
Windows will automatically create the necessary Recovery, System, and Reserved partitions for you. ⚠️ Common Troubleshooting Clean Install of Windows 10 on a NVME m.2 Drive