Original post : diskpart - Guide for Windows XP, Vista, 7, 8, 10.
diskpart
Microsoft DiskPart version 6.1.7600 Copyright 1999-2008 Microsoft Corporation. On Computer: MY_COMPUTER
select
select disk
select partition
select volume
detail disk
detail partition
detail volume
list disk
list partition
list volume
active
assign
create partition primary size=SIZE_IN_MB
SIZE_IN_MB
create partition extended size=SIZE_IN_MB
create partition logical size=SIZE_IN_MB
delete partition
extend
remove
add disk
break disk
create volume stripe
create volume raid
delete disk
extend disk
import
online
retain
convert mbr
convert gpt
convert dynamic
convert basic
exit
clean
rescan
help
0
1
2
3
4
5
cmd
You need to run these steps as an Administrator on Windows Vista systems.
For the full list of diskpart commands and paremeters, go to Commands and Parameters.
If a "Repair Your Computer" option isn't listed, System Recovery Options is not installed on your computer. Use the original installation disc or go to the "If you use Easy Recovery Essentials"set of instructions below .
Note that you need to run these steps as an Administrator on Windows 7 computers.
If Repair Your Computer is not listed, System Recovery Options is not installed on your PC. Go to If you use Easy Recovery Essentials for an alternative.
select disk 2
create partition primary
DiskPart marked the current partition as active.
format fs=ntfs label="MY USB DRIVE"
ntfs