How can I use Diskpart to partition a disk?

John Savill

December 10, 2006

1 Min Read
ITPro Today logo in a gray background | ITPro Today

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
clean
create partition primary
select partition 1
assign letter=c:
active
format
exit

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=" (e.g. "create partition primary size=10000") to create a 10GB C: drive. The figure shows the partitioning process in action.

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like