0% found this document useful (0 votes)
519 views6 pages

Essential DOS Commands

The document provides information on various DOS commands and their functions. It lists commands like ATTRIB, CD, CHKDSK, CLS, COMMAND, COMP, COPY and provides brief descriptions of what each command does and basic syntax. The summary provides high-level information about the document's content in 3 sentences: The document lists and describes various DOS commands, their functions, and basic syntax. It covers both internal and external commands used in DOS for tasks like managing files and directories, checking and formatting disks, copying files, clearing screens, and changing directories. Brief explanations are provided for each command listed along with typical parameters and syntax.

Uploaded by

api-3858983
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
519 views6 pages

Essential DOS Commands

The document provides information on various DOS commands and their functions. It lists commands like ATTRIB, CD, CHKDSK, CLS, COMMAND, COMP, COPY and provides brief descriptions of what each command does and basic syntax. The summary provides high-level information about the document's content in 3 sentences: The document lists and describes various DOS commands, their functions, and basic syntax. It covers both internal and external commands used in DOS for tasks like managing files and directories, checking and formatting disks, copying files, clearing screens, and changing directories. Brief explanations are provided for each command listed along with typical parameters and syntax.

Uploaded by

api-3858983
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

ESSENTIAL DOS COMMANDS

ATTRIB (External) Sets or displays the read-only, archive, system, and hidden attributes of a file or directory.

ATTRIB [d:][path]filename [/S]


ATTRIB [+R|-R] [+A|-A] [+S|-S] [+H|-H] [d:][path]filename [/S]

+R makes a file read-only. Read-only files may be read but they can`t be changed or deleted.
-R removes the file protection attribute (so it can be read, changed, or deleted).
+A sets the ARCHIVE attribute of a file.
-A turns off the ARCHIVE attribute.
+H sets the HIDDEN attribute of a file.
-H turns off the HIDDEN attribute.
+S sets the SYSTEM attribute and the file will not appear in a directory listing.
-S turns off the SYSTEM attribute.
/S sets attributes on subdirectories found within the specified path.

CD (Internal) Displays working (current) directory and/or changes to a different directory.

CD [d:]path

CHKDSK (External) Checks a disk and provides a file and memory status report.

CHKDSK [d:][path][filename] [/F][/V]

CLS (Clear Screen) (Internal) Clears (erases) the screen.

CLS

COMMAND (External) Starts a new version of the DOS command processor.

COMMAND [d:][path] [device] [/P][/E:(size)] [/MSG][/Y [/C (command)|/K (command)]

COMP (External) Compares two groups of files to find information that does not match.

COMP [d:][path][filename] [d:][path][filename] [/A][/C][/D][/L][/N:(number)]

COPY (Internal) Copies and appends files.

COPY [/Y|-Y] [/A][/B] [d:][path]filename [/A][/B] [d:][path][filename] [/V]

DATE (Internal) Displays and/or sets the system date.

DATE mm-dd-yy

DEBUG (External) An MS-DOS utility used to test and edit programs.

DEBUG [pathname] [parameters]

DEFRAG (External) Optimizes disk performance by reorganizing the files on the disk.

DEFRAG [d:] [/F][/S[:]order] [/B][/skiphigh [/LCD|/BW|/GO] [/H]

DEL (ERASE) (Internal) Deletes (erases) files from disk.

DEL (ERASE) [d:][path]filename [/P]

DELTREE (External) Deletes (erases) a directory including all files and subdirectories that are in it.
DELTREE [/Y] [d:]path [d:]path[...]

DEVICE (Internal) Used in the CONFIG.SYS file to tell DOS which device driver to load.

DEVICE=(driver name)

DEVICEHIGH (Internal) Used to install the device driver into the upper memory area.

DEVICEHIGH=(driver name)

DIR (Internal) Displays directory of files and directories stored on disk.

DIR [d:][path][filename] [/A:(attributes)] [/O:(order)] [/B][/C][/CH][/L][/S][/P][/W]

DISKCOMP (External) Compares the contents of two diskettes.

DISKCOMP [d:] [d:][/1][/8]

DISKCOPY (External) Makes an exact copy of a diskette.

DISKCOPY [d:] [d:][/1][/V][/M]

DOS (Internal) Used in the CONFIG.SYS to load DOS into the upper memory area and to specify upper memory blocks.

DOS=[high|low],[umb|noumb]

DOSKEY (External) Program used to recall DOS commands.

DOSKEY [reinstall] [/bufsize=size][/macros][/history][/insert|/overstrike] [macroname=[text]]

ECHO (Internal) Displays messages or turns on or off the display of commands in a batch file.

ECHO on|off
ECHO (message)

EDIT (External) Starts the MS-DOS editor, a text editor used to create and edit ASCII text files.

EDIT [d:][path]filename [/B][/G][/H][/NOHI]

EMM386 (External) Enables EMM386 expanded-memory support on a computer with an 80386 or higher processor.

EMM386 [on|off|auto] [w=on|off]

FASTHELP (External) Displays a list of DOS commands with a brief explanation of each.

FASTHELP [command][command] /?

FC (External) Displays the differences between two files or sets of files.

FC [/A][/C][/L][/Lb n][/N][/T][/W][number] [d:][path]filename [d:][path]filename


or (for binary comparisons)
FC [/B][/number] [d:][path]filename [d:][path]filename

FDISK (External)

FDISK [/status]

Prepares a fixed disk to accept DOS files for storage.

/status Displays partition information.


/mbr copies the Master Boot Record

Undocumented FDISK commands:

FDISK 1/PRI:100 - Command line to create a 100 meg DOS partion on hard drive 1.
FDISK 1/EXT:500 - Command line to create a 500 meg extended DOS partion on hard drive 1.
FDISK 1/LOG:250 - Command line to create a 250 logical drive.
FDISK /PARTN - Saves the partion to a file called PARTSAV.FIL

FILES (Internal) Used in CONFIG.SYS to specify the maximum number of files that can be open at the same time.

FILES=(number)

FORMAT (External) Formats a disk to accept DOS files.

FORMAT d:[/1][/4][/8][/F:(size)] [/N:(sectors)] [/T:(tracks)][/B|/S][/C][/V:(label)] [/Q][/U][/V]

/1 - Format for single-sided use, regardless of the drive type.


/4 - Formats a double-density diskette in a high-density type disk drive.
/8 - Formats at 8 sectors per track. If /8 is not specified, FORMAT defaults to 9 or 15 sectors per track.
/F:(size) - Formats disks to specific sizes.
/N:(sectors) - Specifies the number of sectors per track on the disk.
/T:(tracks) - Specifies the number of tracks on the disk.
/B - Formats a disk reserving room on the disk to later copy the DOS system files.
/S - Copies the operating system files to the disk after formatting.
/C - Causes FORMAT to retest badclusters.
/V:(label) - Volume label is named.
/Q - Quick format; erases the file allocation table and the root directory, but does not identify bad sectors.
/U - Completely erases all data on the target disk making it impossible to perform an UNFORMAT later.

HELP (External) Displays information about DOS commands.

HELP [command] [/B][/G][/H][/NOHI]

INTERLINK (External) Connects two computers via parallel or serial ports to share disks and printer ports.

INTERLINK [client[:]=[server][:]]

INTERSVR (External) Starts the Interlink server.

INTERSVR [d:][...][/X=d:][...] [/LPT:[n|address]] [/COM:[n|address]][/baud:rate] [/B][/V]


INTERSVR /RCOPY

LABEL (External) Creates or changes or deletes a volume label for a disk.

LABEL [d:][volume label]

LASTDRIVE (Internal) Used in CONFIG.SYS to set the maximum number of drives that can be accessed.

LASTDRIVE=(drive letter)

LOADHIGH (Internal) Loads memory resident application into reserved area of memory (between 640K-1M).

LOADHIGH (LH) [d:][path]filename [parameters]

MEM (External) Displays installed and available memory, including extended, expanded, and upper memory.

MEM [/program|/debug|/classify|/free|/module(name)] [/page]

MEMMAKER (External) Starts the MemMaker program, a program that lets you optimize memory.
MEMMAKER [/B][/batch][/session][/swap:d] [/T][/undo][/W:size1,size2]

MIRROR (External) Saves disk storage information that can be used to recover accidentally erased files.

MIRROR [d:]path [d:] path [...]


MIRROR [d1:][d2:][...] [/T(drive)(files)] [/partn][/U][/1]

MD (Internal) Creates a new subdirectory

MKDIR (MD) [d:]path.

MODE (External) Sets mode of operation for devices or communications.

MODE n
MODE LPT#[:][n][,][m][,][P][retry]
MODE [n],m[,T]
MODE (displaytype,linetotal)
MODE COMn[:]baud[,][parity][,][databits][,][stopbits][,][retry]
MODE LPT#[:]=COMn [retry]
MODE CON[RATE=(number)][DELAY=(number)]

MOVE (Internal) Moves one or more files to the location you specify. Can also be used to rename directories.

MOVE [/Y|/-Y] [d:][path]filename[,[d:][path]filename[...]] destination

MSCDEX (External) Used to gain access to CD-ROM drives.

MSCDEX /D:driver [/D:driver2. . .] [/E][/K][/S][/V][/L:letter] [/M:number]

/D:driver specifies the driver signature of the first CD-ROM device driver. This parameter must match the /D switch on
the CONFIG.SYS command that starts the corresponding CD-ROM device driver. The MSCDEX command
must include at least one /D switch.
/E Specifies that the CD-ROM driver be allowed to store sector buffers in expanded memory.
/K Specifies that DOS should recognize CD-ROM volumes encoded in Kanji. By Default, MS-DOS does not recognize Kanji
CD-ROM values.
/S Enables sharing of CD-ROM drives on MS-NET or Windows for Workgroups servers.
/V Verbose switch to direct MSCDEX to display memory statistics when it starts.
/L:letter Specifies the drive letter to assign to the first CD-ROM drive. If you have more than one CD-ROM drive, MS-DOS
assigns additional CD-ROM drives subsequent drive letters.
/M:number Specifies the number of sector buffers (uses RAM).

MSD (External) Provides detailed technical information about your computer.

MSD [/B][/I]
MSD [/I] [/F[d:][path]filename [/P[d:][path]filename [/S[d:][path]filename

PATH (Internal) Sets or displays directories that will be searched for programs not in the current directory.

PATH [d:]path[;][d:]path[...]

PROMPT (Internal) Changes the DOS command prompt.

PROMPT [prompt text] [options]

$ invokes the meta-string for the letter instead of the letter itself. P=path; G=”>”; D=date; T=time; etc.

REM (Internal) Used in batch files and in CONFIG.SYS to insert remarks (that will not be acted on).

REM [comment]
RENAME (Internal) Changes the filename under which a file is stored.

RENAME (REN) [d:][path]filename [d:][path]filename

RD (Internal) Removes a subdirectory.

RD [d:]path

SCANDISK (External) Disk analysis and repair tool used to check a drive for errors and correct any problems that it finds.

SCANDISK [d: [d: . . .]|/all][/checkonly|/autofix[/nosave]|/custom][/surface][/mono][/nosummay]


SCANDISK volume-name[/checkonly|/autofix[/nosave]|/custom][/mono][/nosummary]
SCANDISK /fragment [d:][path]filename
SCANDISK /undo [undo-d:][/mono]

SET (Internal) Inserts strings into the command environment.

SET (string1)=(string2)

SETVER (External) Displays the version table and sets the version of DOS that is reported to programs.

SETVER [d:]:path][filename (number)][/delete][/quiet]

SHARE (External) Installs support for file sharing and file locking.

SHARE [/F:space] [/L:locks]

SHELL (Internal) Used in CONFIG.SYS to specify the command interpreter that DOS should use.

SHELL=[d:][path]filename [parameters]

SMARTDRV (External) Installs and configures the SMARTDrive disk-caching utility.

SMARTDRV [/X] [[drive[+|-]]...] [/U] [/C | /R] [/F | /N] [/L] [/V | /Q | /S]
[InitCacheSize [WinCacheSize]] [/E:ElementSize] [/B:BufferSize]

/X Disables write-behind caching for all drives.


drive Sets caching options on specific drive(s). The specified drive(s) will have write-caching disabled unless you add +.
+ Enables write-behind caching for the specified drive.
- Disables all caching for the specified drive.
/U Do not load CD-ROM caching module.
/C Writes all information currently in write-cache to hard disk.
/R Clears the cache and restarts SMARTDrive.
/F Writes cached data before command prompt returns (default).
/N Doesn't write cached data before command prompt returns.
/L Prevents SMARTDrive from loading itself into upper memory.
/V Displays SMARTDrive status messages when loading.
/Q Does not display status information.
/S Displays additional information about SMARTDrive's status.
InitCacheSize Specifies XMS memory (KB) for the cache.
WinCacheSize Specifies XMS memory (KB) for the cache with Windows.
/E:ElementSize Specifies how many bytes of information to move at one time.
/B:BufferSize Specifies the size of the read-ahead buffer.

STACKS (Internal) Used in CONFIG.SYS to set the number of stack frames and the size of each stack frame.

STACKS=(number),(size)

SYS (External) Transfers the operating system files to another disk.


SYS [source] d:

TIME (Internal) Displays and sets the current time setting of system clock.

TIME hh:mm[:ss][.cc][A|P]

TREE (External) Displays directory paths and (optionally) files in each subdirectory.

TREE [d:][path] [/A][/F]

/A Specifies ASCII characters will be used to draw the tree diagram


/F Displays the names of the files found within each directory listed.

TYPE (Internal) Displays the contents of a file.

TYPE [d:][path]filename

UNDELETE (External) Restores files deleted with the DELETE command.

UNDELETE [d:][path][filename] [/DT|/DS|/DOS]


UNDELETE [/list|/all|/purge[d:]|/status|/load|/U|/S[d:]|/Td:[-entries]]

UNFORMAT (External) Used to undo the effects of formatting a disk.

UNFORMAT d: [/J][/L][/test][/partn][/P][/U]

VER (Internal) Displays the DOS version number.

VOL (Internal) Displays a disk's volume label.

XCOPY (External) Copies directories, subdirectories, and files.

XCOPY [d:][path]filename [d:][path][filename] [/A][/D:(date)] [/E][/M][/P][/S][/V][/W][Y\-Y]

/A Copies only files that have been set as archive files


/D:(date) Copies only those files that have been changed on or LATER than the specified date.
/S Copies all files in the current directory and in any subdirectory within it.
/E Copies subdirectories, even if they are empty. If you use this option, you must use the /S option also.
/M Copies archive files (as in the /A option) however, the files on the destination disk are not marked as archive files. This
switch checks the archive attribute of a file: if the file`s archive attribute is set to off (-A), the file will not be copied.
/P Prompts you to confirm that you want each file copied.
/V Verify that each file is copied identically to the original.
/W Waits until you respond to a prompt to begin copying.
/Y Causes XCOPY to replace existing files without a confirmation prompt.
/-Y Causes XCOPY to give you a confirmation prompt before replacing an existing file.

SYNTAX NOTES
1. COMMAND NAME The DOS command name is the name you enter to start the DOS program.
2. SPACE Always leave a space after the command name.
3. DRIVE DESIGNATION The drive designation (abbreviated in this book as "d:") is an option for many DOS commands.
4. COLON When referring to a drive in DOS you must always follow the drive designator with a colon “:”.
5. PATHNAME A pathname (path) refers to the path you want DOS to follow in order to act on the DOS command.
6. FILENAME A filename is the name of a file stored on disk. A filename can be eight characters.
7. FILENAME EXTENSION A filename extension follows the filename after a period and can be three characters.
8. PARAMETERS The files and directories to be manipulated by DOS. Usually comprised of SOURCE and DESTINATION.
9. SWITCHES Characters preceded by a forward slash (for example, "/S") are command options.
10. BRACKETS Items enclosed in brackets are optional.
11. ELLIPSES Ellipses (...) indicate that an item in a command syntax can be repeated as many times as needed.
12. VERTICAL BAR Items separated by a vertical bar (|), means you enter either one of the items. For example: ON | OFF.

You might also like