Disk Operating System

DOS External Commmands Handout

Instructions for external commands are disk-based. This means the file with the name of the command must be loaded into RAM at the moment when the command is given. Application programs are external commands and some DOS programs are external. The syntax for some of the more useful DOS external commands, including their parameters and switches follow:

FORMAT
Prepares a diskette for use by DOS.

Syntax: FORMAT [d:]

Parameters: [d:] = Drive which is to receive the format.

Optional switches:

  • /s Include all system files necessary to make disk "bootable"
  • /b Reserve space for system files on diskette. (Formats 320k instead of 360k).
  • /v Volume label of 11 characters

Some examples:
  • To format a diskette in drive B: without system files:
  • FORMAT B:

  • To format a diskette in drive A: with system files:
  • FORMAT A: /s

  • To give the formatted diskette a volume name, include the /v switch:
  • FORMAT A: /V

  • Combine switches to format a boot diskette with a volume label:
  • FORMAT A: /S /V

CHKDSK
Analyzes disk or diskette (first and only parameter) and displays disk and memory status report.

Syntax: CHKDSK [d:] [/f] [/v]

Parameters: [d:] = Drive upon which to perform the checkdisk.

Optional switches:

  • /f Fix. Writes lost clusters to a disk file and corrects file allocation table.
  • /v Verbose. Lists all files on a disk.

Example:

  • To display statistics about the diskette in drive A:
  • CHKSDK A:
  • To display statistics about the first hard disk and fix any lost clusters:
  • CHKSDK A: /f

DISKCOPY
Makes an exact copy of a diskette, including hidden system files if they are present.

Syntax: DISKCOPY [d1:] [d2:]

Parameters:[d1:] = Drive for source diskette, [d2:] = Drive for target diskette.

Example:

  • To make an exact copy of a diskette in drive A: to a diskette in B:
  • DISKCOPY A: B:
  • To make an exact copy of a diskette using only drive A:
  • DISKCOPY A: A:

    (Change source and target diskettes as requested).
DISKCOPY asks for a SOURCE diskette (the diskette being copied) and a TARGET diskette (the diskette being copied to). The TARGET diskette need not be formatted, DOS will format it while doing the DISKCOPY. If the SOURCE diskette is bootable, the system will be transferred to the TARGET as well. The two disk drives must always use the same media.




Bruce Miller, 2002
Disk Operating System Index
Course Handouts Index