How can I use Diskpart to partition a disk?

A. As part of a deployment using Microsoft Windows Preinstallation Environment (WinPE), you might need to partition the disk. The easiest way to do this is to place into a file the following commands:

select disk 0
create partition primary
select partition 1
assign letter=c:

Then execute the commands using the Diskpart command with the the /s parameter, as the following example shows:


diskpart /s partscript.txt

The command creates one partition with all the space; alternatively, you can replace the "create partition primary" with "create partition primary size=<size in MB>" (e.g. "create partition primary size=10000") to create a 10GB C: drive. The figure shows the partitioning process in action.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.