Formats the partition or volume with focus for use with Windows.

For examples of how this command can be used, see Examples.


format [{fs=<ntfs|fat|fat32>] [revision=<x.xx>] | recommended}] [label=<"label">] [unit=<n>] [quick] [compress] [override] [nowait] [noerr]


Parameter Description


Specifies the type of file system. If no file system is specified, the default file system is used. The default file system is displayed by the filesystems command in DiskPart.


Specifies the file system revision (if applicable).


If a recommended file system exists, it uses that file system and revision, instead of the default file system and revision. The recommended file system (if one exists) is displayed by the filesystems command in DiskPart.


Specifies the volume label.


Overrides the default allocation unit size. Default settings are strongly recommended for general use. The default allocation unit size for each file system supported by the volume is displayed by the filesystems command in DiskPart. Note that NTFS compression is not supported for allocation unit sizes above 4096.


Performs a quick format.


Only for volumes that will be formatted with the NTFS file system. Files created on the new volume will be compressed by default.


Forces the volume to dismount first if necessary. All opened handles on the volume will no longer be valid.


Format will return immediately while the format is still in progress. If this parameter is not specified, DiskPart will print out formatting progress in percentage.


For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code.


  • A partition or volume must be selected for this operation to succeed. Use the select partition or the select volume command to select a partition or volume and shift the focus to it.


To perform a quick format of a partition or volume with the NTFS file system, assign the "Main Volume" label to it, and specify that files added to the new volume be compressed by default, type:

format fs=ntfs label="Main Volume" quick compress

Additional references