DOS Command Reference A - J

The following command list identifies the DOS version when each command (and some parameters) first came into use and for commands no longer supported the last version where the command was used. Note that many commands were removed in DOS 6.0 and DOS 7.0 (Windows 95) as they had been long superseded by other commands or by windows functionality. This reference deals with IBM's PC-DOS and Microsoft's MS-DOS (which were both originally created by Microsoft and supposedly identical). Other versions of DOS may have different commands. Not all flags available in DOS 6.0 and DOS 7.0 have been listed, use the /? flag with the command to get a complete list.

K - Z

APPEND (DOS 3.2 external command) DOS 7.0 no longer valid
set search path for data files
  • /X extend search path
  • /E store search path in environment
 
ASSIGN (DOS 2.0 external command) DOS 6.0 no longer valid
used to reassign drive letters
format: ASSIGN x=y
where x is the drive where reads and writes are currently sent, = is optional, and y is the drive where you want the reads and writes sent. The colons following the drive letters do not need to be entered. You can assign multiple drives in one statement or set everything back the way it was by leaving off the parameters. The command does not affect the following commands: backup print format diskcopy.
 
ATTRIB (DOS 2.0 external command)
used to display or change file attributes
this allows a file to be flagged as read only format: ATTRIB +r +a path-to-file /S
where +r sets the readonly attribute on the file and -r removes it and (DOS 3.3 onward) +a sets the archive attribute on the file and -a removes it
DOS 4.0 adds /S to include sub-directories
 
BACKUP (DOS 3.0 external command) DOS 7.0 no longer valid
used to backup files from a hard disk
format: BACKUP directory-to-backup backup-to-drive flags
valid flags are
  • /S backup subdirectories as well
  • /M only backup changed files
  • /A append to an existing backup
  • /P pack as many files as possible on each disk (DOS 3.0 - 3.2 only)
  • /F format the disk first (DOS 3.3 onward)
  • /F:size format the disk first (DOS 4.0 onward)
  • /D:date only backup files modified on or after the specified date
  • /T:time only backup files modified at or after the specified time
  • /L:file create a backup log in the specified file (or in BACKUP.LOG if no file is specified)
 
BREAK (DOS 2.0 internal command - config)
used to enable/disable the CTRL-C function that abandons program execution
format: BREAK ON or BREAK OFF
 
BUFFERS (DOS 3.1 internal command - config)
used to set the number of sector buffers
 
CALL (DOS 5.0 internal command - batch)
used to call one batch program from within another without terminating the first
 
CHCP (DOS 3.3 internal command)
display or change the current code page
 
CHDIR or CD (DOS 2.0 internal command)
used to change from one directory to another
format: CHDIR new-directory or CD new-directory
 
CHKDSK (DOS 1.0 external command)
used to scan for errors in the file allocation table
format: chkdsk drive-or-directory flags
valid flags are
  • /F correct errors found
  • /V display messages while running
 
CHOICE (DOS 6.0 internal command - batch)
used to prompt the user to select one of several branches
format: CHOICE prompt-text flags
valid flags are
  • /C:keylist list of valid responses (default YN)
  • /N do not prompt
  • /S response is case sensitive
  • /T:c,nn if no response received within nn seconds use c as the response
 
CLS (DOS 2.0 internal command)
used to clear the screen
 
COMMAND (DOS 3.1 external command)
used to start another copy of the command processor for internal commands
format: COMMAND drive-or-directory cttydev flags
cttydev allows you to specify a different device for input and output
valid flags are
  • /P do not exit to a higher level
  • /C program execute the specified program and return
 
COMP (DOS 3.2 external command) DOS 6.0 no longer valid
compare two files and report differences
 
COPY (DOS 1.0 internal command)
used to copy a file from one name (or place) to another
format: COPY from-location to-location flags
to-location defaults to the current path and is optional
this command accepts wildcard characters
valid flags are
  • /V verify file as written
  • /A ascii text file
  • /B binary file
 
COUNTRY (DOS 3.3 internal command - config)
used to select the date and time format when you first access DOS
 
CTTY (DOS 2.0 internal command)
used to change the standard input/output devices
 
DATE (DOS 1.0 internal command)
displays the current date
or with optional parameter sets the current date to the specified value
 
DBLSPACE (DOS 6.0 and 6.2 only external command)
disk compression routine
 
DEBUG(DOS 1.0 external command)
used to load and write programs, set individual memory locations and registers and dump specified sections of memory
 
DEL or ERASE (DOS 1.0 internal command)
used to delete a file
format: DEL filename or ERASE filename
this command accepts wildcard characters
DOS 4.0 adds /P to prompt before deleting
 
DELTREE (DOS 6.0 external command)
delete an entire directory including all files and sub-directories
use /Y flag to suppress prompt
 
DEVICE (DOS 3.0 internal command - config)
used to create and install virtual disk drives
from DOS 3.3 onward used to install any device drivers including ansi.sys display.sys driver.sys printer.sys ramdrive.sys from DOS 4.0 onward smartdrv.sys and from DOS 5.0 onward EGA.SYS EMM386.EXE HIMEM.SYS SETVER.EXE
 
DEVICEHIGH (DOS 5.0 internal command - config)
same as DEVICE but loads into upper memory area
 
DIR (DOS 1.0 internal command)
used to display the contents of the current or a specified directory
format: DIR directory-path flags
valid flags are
  • /P pause when screen is filled
  • /W display five per line (without size and timestamp)
  • /C report on compression ratios (DOS 6.0 onwards)
 
DISKCOMP (DOS 3.2 external command) DOS 7.0 no longer valid
compares two disks and reports differences
 
DISKCOPY (DOS 2.0 external command)
used to copy an entire disk to another of the same configuration
format: DISKCOPY from-location to-location
 
DOS (DOS 5.0 internal command - config)
maintains a link to the upper memory area or even load part of DOS into the upper memory area
format: DOS=HIGH,UMB
can specify high or low as to where DOS is to load and umb or noumb as to whether a link to upper memory should be maintained
 
DOSKEY (DOS 5.0 external command)
used to recall previously entered DOS commands
 
DOSSHELL (DOS 4.0 external command)
a graphical interface to DOS
 
DRIVPARM (DOS 3.3 internal command - config)
used to override parameters for block devices
 
DRVSPACE (DOS 6.22 only external command) DOS 7.0 no longer valid
disk compression routine
 
ECHO (DOS 2.0 internal command - batch)
used to suppress display of commands in a batch file while it is executing
 
EDIT (DOS 5.0 external command)
full screen editor
 
EDLIN(DOS 1.0 external command) DOS 6.0 no longer valid
line oriented text editor
 
EMM386 (DOS 5.0 external command)
enable or disable expanded memory support
 
EXE2BIN(DOS 1.0 external command) DOS 6.0 no longer valid
converts programs (under 64k) to a special faster and smaller binary format
 
EXIT (DOS 3.1 internal command)
used to stop the command processor for internal commands and return to the previous one
 
FASTOPEN (DOS 3.3 internal command) DOS 7.0 no longer valid
reduce amount of time required to open frequently used files and directories
 
FC (DOS 3.1 external command)
used to compare the contents of two files and highlight the differences
 
FCBS (DOS 3.0 internal command - config)
used to specify the maximum number of file control blocks that can be opened concurrently
 
FDISK (DOS 3.3 internal command)
used to create and delete partitions on a hard disk
 
FILES (DOS 3.1 internal command - config)
used to specify the maximum number of files that can be open concurrently
 
FIND (DOS 2.0 external command)
used to search a text file for the occurrence of a specified text string
format: FIND "string" directory-or-file-to-search flags
valid flags are
  • /V display all lines NOT containing the string
  • /C only display a count of the number of lines containing the string
  • /N display relative line numbers in front of each line
 
FOR (DOS 2.0 internal command - batch)
used to set up loops within batch files
 
FORMAT(DOS 1.0 external command)
readies a disk drive for use with DOS
can also be used to completely clear the contents of a disk
format: FORMAT drive flags
valid flags are
  • /O produce an IBM PC-DOS 1.0 disk (before DOS 3.2 only)
  • /V prompt for a volume label after formatting
  • /S copy the three operating system files to the disk after formatting
  • /1 format single side only (DOS 3.3 onwards)
  • /4 format 5-1/4" double sided disk in a high density drive (DOS 3.3 onwards)
  • /8 format 8 sectors per track (DOS 3.3 onwards)
  • /B format disk leaving space for DOS 3.3 (DOS 3.3 and 4.0 only)
  • /T:80 format a 3-1/2" disk (DOS 3.3 onwards)
  • /N:9 specify number of sectors per track on a 720k disk (DOS 3.3 onwards)
  • /V:label supplies volume label (DOS 5.0 onwards)
  • /F:size specify size of drive to format (DOS 5.0 onwards)
  • /Q quick format (DOS 5.0 onwards)
  • /U unconditional format (DOS 5.0 onwards)
 
GOTO (DOS 2.0 internal command - batch)
used to transfer control to a different line within a batch file
 
GRAFTABL (DOS 3.2 internal command) DOS 6.0 no longer valid
defines extended character set for use with graphics
 
GRAPHICS (DOS 3.2 internal command) DOS 7.0 no longer valid
lets you print from your graphics display to a printer
 
HELP or /? (DOS 5.0 external command)
get online help
only /?form valid in DOS 7.0
 
IF (DOS 2.0 internal command - batch)
used to create conditional branches within a batch file
 
INSTALL (DOS 4.0 internal command - config)
execute a fastopen, keyb, nlsfunc, or share command during configuration
 
JOIN (DOS 3.0 external command) DOS 6.0 no longer valid
used to join a drive to a specified path
format: JOIN drive path flags
the /D flag is used to turn off a join
 

K - Z

 

This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow
Donate