Menu

Home
Products
Fantasy Artists
Everything Else...
PC Help
Links
 


 

PC Help

 DOS

Overview
Boot Files
Commands
 

 
 Windows

Software
 


DOS Commands

 DOS Command Listing

This is a listing of DOS commands. They may vary slightly depending on the version of DOS your using. There's too many to cover in great detail. A few of the most needed are covered below.

MS-DOS Commands

append diskcopy join restore
assign doskey keyb rmdir
attrib dosshell label set
backup edit loadhigh setver
break edlin mem share
chcp emm386 mirror sort
chdir exit mkdir subst
chkdsk expand mode sys
cls fastopen more time
command fc nlsfunc tree
comp fdisk path type
copy find print undelete
ctty for prompt unformat
date format qbasic ver
del graftable recover verify
dir graphics rename vol
diskcomp help replace xcopy

 

Batch Commands

call for if rem
echo goto pause shift

 

CONFIG.SYS Commands

break devicehigh files shell
buffers dos install stacks
country drivparm lastdrive switchs
device fcbs rem

 

Edlin Commands

(line) e (end) p (page) t (transfer)
a (append) i (insert) q (quit) w (write)
c (copy) l (list) r (replace)
d (delete) m (move) s (search)

 


 top DOS Commands in Detail

This is a few of the most important commands in greater detail. Some of the commands have additional switches that were intentionally left out due to space. The individual items that may typed after a command are held by [ ]. Place a space in the command wherever a space exist in the example.

 


 top ATTRIB [+r|-r] [+a|-a] [+s|-s] [+h|-h] [drive:][path][filename] [/s]
The Directory command lists all the files and subdirectories in the current directory or in the path specified.

Examples:

ATTRIB -r -s -h C:\*.SYS
ATTRIB +r +s C:\*.*
ATTRIB -h C:\MSDOS.SYS

Switch Description
/s Process's files in current directory and all of its subdirectories.
 
+h Set files Hidden attribute
-h Clears the Hidden attribute
+s Set files System attribute
-s Clears the System attribute
+a Sets files Archiving (backup) attribute
-a Clears files Archiving attribute
+r Set files Read-Only attribute
-r Clears files Read-Only attribute

 


 top CHDIR or CD [drive:][path] or [..] or [\]
The Change directory command is used to change directories. The command followed by two periods backs up one directory while the backslash returns to the root drive. The root is the drive letter and no directories. For Example, A:\ C:\ and D:\ are roots while C:\games is not.

Examples:

CD C:\Games\Doom
CD Games\Doom
CD..
CD \

 


 top CLS
Clears the screen.

Examples:

CLS

 


 top COPY [source] [destination] [/v]

The Copy command copies files from one location (the source) to a second location (the destination). If you give a different filename for the destination the name of the file will be changed at the same time it's copied. By using wildcards entire groups of files can be copied at once.

Examples:

COPY A:\*.* C:\*.*
COPY C:\Letters\*.exe A:\Backup /v
COPY note.txt C:\text\notes\note.asc

Switch

Description

/v

Verifies that new files are written correctly

 


 top DATE [mm-dd-yy]
The Date command sets the date.

Examples:

DATE [03-12-98]

 


 top DEL (ERASE) [drive:][path][filename] [/p]

The Delete command deletes files from the specified path. By using wildcards entire groups of files can be deleted.

Examples:

DEL C:\*.txt
DEL C:\Letters\*.doc /p
DEL note.txt

Switch

Description

/p

Prompts for confirmation before deleting files

 


 top DIR [drive:][path][filename] [/p] [/w] [/a:attributes] [/o:sortorder]

The Directory command lists all the files and subdirectories in the current directory or in the path specified. If you would like to set the Directory command to behave a certain way all the time add the following line to the Autoexec.bat: SET DIRCMD=[switches]. For example, to set the DIR command to always display 1 screen at a time with directories grouped at the top add: SET DIRCMD=/p /og. When DIR is typed the switches /p /og will be understood.

Examples:

DIR A:
DIR C:\Games /p
DIR /p /ah
DIR /w /a-d /on
DIR *.exe

Switch

Description

/p

Displays 1 screen of filenames and stops until a key is pressed

/w

Displays filenames across as well as down

/a

Displays only the files with the attributes listed after the switch

h

Hidden files

-h

Files that are not hidden

s

System Files

-s

Files other then system files

d

Directories

-d

Files only, no directories

a

Files ready for archiving (backup)

-a

Files that have not changed since last backup

r

Read-Only files

-r

Files that are not read only

/o

Controls the order the files are displayed

n

In alphabetic order by name

-n

In reverse alphabetic order

e

In alphabetic order by extension

-e

In reverse alphabetic order by extension

d

By date and time, earliest first

-d

By date and time, latest first

s

By size, smallest first

-s

By size, largest first

g

With directories grouped before files

-g

With directories grouped after files

 


 top EXPAND [source] [destination]
The Expand command is used to expand compressed files on the original DOS disks. DOS files are compressed to save room. The compressed files extension ends in "_". By using Expand it's possible to get a single compressed file off the DOS disks and back where it's needed.

Examples:

EXPAND A:\sort.ex_ C:\dos\sort.exe

 


 top FORMAT [drive:] [/v:label]] [/q] [/u] [/f:size] [/s]

The Format command is used to prepare disks for use with MS-DOS. It's also required to create a Floppy Boot Disk. Note: Format completely erases everything. Make absolutely sure your using the correct drive letter before using Format.

Examples:

FORMAT A: /f:720 /v
FORMAT C: /u

Switch

Description

/v

label Specifies a name for the disk

/q

Deletes the File Allocation Table (FAT) and directory of previously formatted disks for a quick erasing.

/u

Unconditional formatting of the disk. Destroys all existing data on disk and prevents any unformatting.

/f

Specifies the size of the disk to be formatted. If no size is given the disk is formatted to the default size of the floppy drive.

160

160K, single-sided, double density, 5.25"

180

180K, single-sided, double density, 5.25"

320

320K, double-sided, double density, 5.25"

360

360K, double-sided, double density, 5.25"

720

720K, double-sided, double density, 3.5"

1200

1.2Mb, double-sided, high density, 5.25"

1440

1.44Mb, double-sided, high density, 3.5"

2880

2.88Mb, double-sided, 3.5"

/s

Creates a system disk by formatting the disk and copying the IO.SYS, MSDOS.SYS and COMMAND.COM files onto it. Use this option to create a Floppy boot disk.

 


 top LABEL [drive:][label]
The Label command is used to view and change a disks label. A label is 11 Characters and may not contain: * ? / \ | . , ; : + = [ ] ( ) & ^ < > "

Examples:

LABEL C:
LABEL C:DOS BOOT

 


 top MEM [/p|/d|/c]

The Mem command is used to view the amount of free memory. Use this command to see how well your editing the Autoexec.bat and Config.sys to free up memory.

Examples:

MEM
MEM /p

Switch

Description

/p

Program - Displays tyhe status of programs currently loaded into memory

/d

Debug - Displays the status of currently loaded programs, internal drivers and other programming information

/c

Classify - Displays the status of programs loaded into conventional memory and upper memory area.

 


 top PROMPT [text]

The Prompt command is used to change the DOS prompt. It can include plain text and the symbols listed below.

Examples:

PROMPT
PROMPT $p
PROMPT Windows95 $p
PROMPT The time is: $t $_The date is: $d

Symbols

Description

$q

= (equal sign)

$$

$ (dollar sign)

$t

Current Time

$d

Current Date

$p

Current Drive and Path

$v

MS-DOS version number

$n

Current Drive

$g

> (greater-than sign)

$l

< (less-than sign)

$b

| (pipe)

$_

ENTER+Linefeed

$e

ASCII escape code (code 27)

$h

Backspace (to delete a character in the prompt command line)

 


 top REM [comment]
The Rem command is used to add comments to certain files. The most common use is in the Config.sys and Autoexec.bat. Anything following REM is ignored by DOS when processing the file. It's a good way to temporarily disable lines that may be causing problems.

Examples:

REM the next line is for the CD drivers

 


 top RENAME (REN) [drive:][path][filename1] [filename2]

The Rename command changes the names of existing files. Wildcards can be used to rename groups of files.

Examples:

RENAME C:\*.txt *.doc
REN letter.doc book.doc

 


 top RMDIR (RD) [drive:][path]
The Remove Directory command deletes empty directories. You can not remove directories containing files. You must first delete all the files in the directory using the Delete command. Some directories may contain hidden files. If an empty directory says it's not empty use Attrib to check for hidden files.

Examples:

RMDIR C:\games\doom
RD documents

 


 top SYS [drive1:][path] [drive2:]
The System command copies the current DOS system files to a second drive. The files IO.SYS, MSDOS.SYS and COMMAND.COM are copied.

Examples:

SYS C:\ A:\
SYS C:\DOS A:\

 


 top XCOPY [source] [destination] [/s] [/e] [/v]

The XCOPY command works exactly like COPY except it has advanced features such as copying subdirectories as well as files.

Examples:

XCOPY C:\DOS A: /s /e
XCOPY A: B: /s

Switch

Description

/s

Copies directories and subdirectories, unless they are empty. Without this switch XCOPY works like COPY

/e

Copies empty subdirectories. Must be used with /s

/v

Verifies each file is correctly written as copied


The contents of this page are 2009 Realm
Last Updated (January 1st, 2007)