Format

Index

Formats a disk for use with MS-Dos.

Syntax:

FORMAT drive: [/Switches]

Switches

/V[:label]Specifies a volume label. If the /V switch is omitted, or label is not specified, a prompt for a volume label is displayed after formatting is completed.
If no volume label is required, the prompt can be avoided by specifying: /V:""
If a label is specified and more than one disk is formatted in a session, all of the disks will be given the same volume label.
/Q"Quick" format of a previously formatted disk.
The disk's file allocation table (FAT) and root directory are deleted but it is not scanned for bad areas.
/SCopies system files to the formatted disk (to make a boot disk).
/BAllocates space on the formatted disk for system files.
/F:sizeFormats a disk to a capacity other than that for which the drive was designed.
size can be: 360, 720, 1.2, 1.44, 2.88.
/T:tracksSpecifies the number of tracks per disk side.
/N:sectorsSpecifies the number of sectors per track.
/1Formats a single side of a floppy disk.
/4Formats a 5.25-inch 360K floppy disk in a high-density drive.
/8Formats eight sectors per track
/CTests clusters that are currently marked "bad." By default, if a disk contains clusters that have been marked as "bad", FORMAT does not retest the clusters; it simply leaves them marked "bad".
/UUnconditional format. This switch was instituted in Dos 5 along with the "Unformat" command. In Dos 7.x the Unformat command has been dropped and all formatting is unconditional. This switch is therefore redundant but possibly maintained so that batch files written with it will not fail.¹
/AUTOTESTFormatting proceeds without further user input or warning messages. All sectors previously marked bad on the hard drive are retested (i.e. equivalent to including the /C switch)². The AUTOTEST switch can be used in conjunction with the /U, /S, and /F switches. It is not compatible with /Q (causing an error message) and /V is ignored.
/BACKUPNot sure what this does. Seems to be similar to /AUTOTEST except that it asks for a Volume label, and displays data on number of bytes available, etc. Haven't tried it with c: drive so don't know whether it warns before formatting a hard drive.
/SELECTNot sure what this does - but it seems to "unformat" a disk. Anyway, it renders the disk a "non-system disk" (which can be reformatted).
/Z:nSpecifies the cluster size in multiples of 512 bytes. Valid values of n are:

nCluster sizenCluster size
1512 bytes168K
21K3216K
42K6432K
84K

Notes:

  1. Unless used with the /Q switch, FORMAT assumes that a floppy disk in a 3.5" drive is to be formatted at 1.44Mb. If the disk is 720 Kb, the /F:720 switch must be used or an error message results. If the /Q switch is used, FORMAT checks the existing format and will detect a disk formatted at 720 Kb.

  2. By default, and unless the /Q switch is used, each sector on the disk is checked during the formatting process to ensure that the sector can properly store data. If a bad sector is located, it is marked and is not used.

  3. When formatting is complete, a message is displayed showing the total disk space, any space marked as defective, the space used by the operating system (if any), and the space available for files.

  4. When formatting a hard disk, a warning is first displayed:

    C:\WINDOWS>Format c:
     
    WARNING, ALL DATA ON NON-REMOVABLE DISK DRIVE x: WILL BE LOST!
    Proceed with Format (Y/N)?

  5. While the AUTOTEST switch is particularly useful when formatting a bunch of floppy disks, it will work just as well with hard drives so entering FORMAT c: /AUTOTEST gives no opportunity for second thoughts. It is probably advisable to preconfigure the command in a batch file (say "Formata.bat") comprising the single line FORMAT a: /autotest rather than using it directly from the command line.

  6. When a floppy disk is formatted (except when using the /Q switch) all data contained thereon is permanently erased. Every byte in the data area of the disk is overwritten with F6h (ASCII 246), and both sets of the FAT along with the Root area are overwritten with zeroes. When a hard disk is formatted, the data is not erased and I believe there are ways to recover the data (quite possibly using DEBUG in ways I do not comprehend).

  7. Although disks can be formatted in "non-standard" ways, this is not advised. Both disks and drives are designed for operation at their specified formats and faults will occur if used at other formats.

  8. FORMAT cannot be used on a virtual drive created using the SUBST command.

Tricks

A fast way to reformat a floppy is:
ren /? | format /q/v:"" > nul
The ren /? part feeds, along with a load of redundant material, an "enter", followed by a "n, enter" in response to FORMAT's prompts. The >nul prevents the display of the somewhat messy mixed up output of the two commands.

Exit Codes:

0The format operation was successful.
3FORMAT was terminated by Ctrl-C before completion
4A fatal error occurred (any error other than 0, 3, or 5).
5 The user pressed N in response to the prompt "Proceed with Format (Y/N)?" to stop the process.

File Details

File NameDefault LocationDos Ver.Win Ver.SizeDateSource
Format.comc:\windows\command 7.0Win95 40 13511/07/95win95_02.cab
7.1Win95 (OSR2.x) 49 54324/08/96win95_02.cab
Win98 49 575111/05/98win98_28.cab
Win98 SE 49 575123/04/99win98_25.cab

Superscripts denote which same size files, if any, are identical (using FC).


¹ Thanks to Dewey Chan and Bob Ennis for their comments on the /U switch.
² Thanks to Jason Price for his comment on the /Autotest switch
This page last revised:
January 18, 2002