DEV Community

Victor James
Victor James

Posted on • Originally published at on




The FORMAT windows command line is for formatting a disk. To format a specified partition. Let’s see more about the command below in detail.

CMD Line

CMD Line is a text-based interface that transfers the command from the user to the OS.

CLI-Command Line Interpreter

The command-line interpreter (CLI) for windows is CMD.EXE. Also, you can use PowerShell which can automize many system administration tasks and these tasks are not approachable in command prompt. With the help of the CLI, you can communicate with your system by typing the text in commands. As a result, your system answers to the text that you have typed previously, and then the user can proceed with the next command line that shows up.

To open the Run command Window

Run command window helps you to run programs, open the files and folders. And there are several ways to open up the run command dialog box. This run command box is useful for you to head straight to the destined program easily.

By using the Keyboard shortcut Key:


One of the most commonly used methods is the Shortcut key method. Also, this method is in all versions of Windows. You need to press the Windows+ R key concurrently to open the Run command dialog box.

Run command box
Run command box

What does the FORMAT command do?

As we mentioned earlier in this guide, this command is for formatting a disk. To format a disk for the use of Windows. To execute this command you must need to be a member of the administrator’s groups to format a hard drive.


FORMAT volume [/FS:file-system] [/V:label] [/Q] [/L] [/A:size] [/C] [/I:state] [/X] [/P:passes] [/S:state]
FORMAT volume [/V:label] [/Q] [/F:size] [/P:passes]
FORMAT volume [/V:label] [/Q] [/T:tracks /N:sectors] [/P:passes]
FORMAT volume [/V:label] [/Q] [/P:passes]
FORMAT volume [/Q]

Enter fullscreen mode Exit fullscreen mode

Parameter Explanation

  • Volume – Specifies the drive letter , followed by a colon, mount point, or volume name.
  • /FS:file-system – The type of the file system like FAT, FAT32, exFAT, NTFS, UDF, ReFS.
  • /V:labelVolume label.
  • /Q – To perform a quick format. This switch overrides /P (zero out bytes).
  • /C – This key make Compression-files added to the new disk will be compressed by default (NTFS only).
  • /X – Persuades the volume to dismount first if necessary. All opened handles to the volume would no longer be valid.
  • /R:revision – UDF only: Force the format to a specific UDF version. Default= 2.01
  • /D – UDF 2.50 only: Metadata will be duplicated.
  • /L – NTFS Only: Use large size file records. By default, the volume will be formatted with small size file records.
  • /A:size – overrides the default allocation unit size. Default settings are recommended.
  • /T:tracks – Specifies the number of tracks per disk side.
  • /N:sectors – Specifies the number of sectors per track.

Key explanation

  • /P:countZero every sector on the volume. After that, the volume will be overwritten “count” times using a different random number each time. If “count” is zero, no additional overwrites are made after zeroing every sector. This switch is ignored when /Q is specified.
  • /S:state – Supports for short filenames , Short names are disabled by default.
  • /I:stat – ReFS only: enable integrity on the new volume. “State” is either “enable” or “disable” Integrity is enabled on storage that supports data redundancy by default.
  • /F:size – The size of the floppy disk to format.
  • /DAX[:state]– NTFS Only: Enable direct access storage (DAX) mode for this volume. In DAX mode, the volume is accessed via the memory bus, boosting IO performance. A volume can be formatted with DAX mode only if the hardware is DAX capable. State can specify “enable” or “disable”. /DAX is considered as /DAX:enable.
  • /LogSize[:size]– NTFS Only: The size for NTFS log file in kilobytes.
    • The minimum supported size is 2 MB ,
    • Zero indicates the default value , which generally depend on the volume size.
  • /NoRepairLogs – NTFS Only: Disables the NTFS repair logs. If the flag is set, spot fix (i.e., chkdsk /spot fix) will not work.

Unit sizes

  • FAT and FAT32 : 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K. Also, 128K and 256K for a sector size greater than 512 bytes.
  • NTFS : 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K.
  • exFAT : 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K, 128K, 256K, 512K, 1M, 2M, 4M, 8M, 16M, 32M.
  • ReFS : 64K.

Note: The FAT and FAT32 files systems enforce restrictions on the number of clusters on a volume:

FAT: Number of clusters <= 65526

FAT32: 65526 < Number of clusters < 4177918


  • In order to format a new floppy disk in drive c using the default size, type use

format c:

Enter fullscreen mode Exit fullscreen mode
  • Reformatting

@echo off
Echo Warning this will reformat the entire D: disk!
format D: /FS:NTFS /x

Enter fullscreen mode Exit fullscreen mode


The FORMAT windows command-line tool, which is used to format the disk. If you want to know more commands with syntax and examples, visit our websites. If you have any suggestions, let us know, we will update them shortly.

Related articles

  • FORFILES The FORFILES command-line tool is to execute a command on a file or set of files. This command was executed mostly in batch files.
  • FORMAT The FORMAT windows command line is for formatting a disk. To format a disk for the use of Windows.
  • FTP The FTP stands for File Transfer Protocol. This command-line tool is transfers files from a computer executing an FTP server service.
  • GPUPDATE The GPUPDATE windows command-line tool is used to update the Group Policy settings.
  • FTYPE The FTYPE windows command-line tool is to display or else changes File type utilized in extension file associations. FTYPE is an Internal command.

The post FORMAT appeared first on Windows Commands- SS64 Commands.

Discussion (0)