home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 3
/
CDASC03.ISO
/
sorties
/
314
/
dos.txt
< prev
next >
Wrap
Text File
|
1993-04-01
|
38KB
|
1,185 lines
@DOS Commands and Utilities Copyright 1991 David Jurgens
:DOS commands:DOS summary
^DOS Command Summary
~APPEND~ d:path[[;][d:]path...]
APPEND~ [/E][/X]
~ASSIGN~ [x[=]y[...]]
~ATTRIB~ [±A][±R] [d:][path]filespec [/S]
~BACKUP~ d:[path][filespec] d: [/A][/D:date][/F][/L][/M][/S][/T:time]
*BREAK [ON|OFF]
~CD~ [d:][path]
*CHCP codepage
~CHDIR~ [d:][path]
~CHKDSK~ [d:][path][filespec] [/F][/V]
*CLS
~COMMAND~ [device] [/E:size] [/P] [/C [d:][path]cmdstring]
~COMP~ [d:][path][filespec] [d:][path][filespec]
~COPY~ [/A][/B][d:][path]src[/A][/B] [d:][path][dest] [/A][/B][/V]
~CTTY~ device
~DATE~ [mm-dd-yy | mm/dd/yy | mm.dd.yy ]
*DEL [d:][path]filespec
~DIR~ [d:][path][filespec] [/P][/W]
~DISKCOMP~ [d: [d:]] [/1][/8]
~DISKCOPY~ [d: [d:]] [/1]
ECHO [ON | OFF] [text] (see ~BATCH~)
~EDLIN~ [d:][path]filename [/B]
~ERASE~ [d:][path]filespec
*EXIT
*FASTOPEN d:[=n]
~FC~ [/B][/C][/L][LBn][/N][/nnnn][/T][/W] [d:]pathname1 [d:]pathname2
~FDISK~ (menu driven)
~FIND~ [/C][/N][/V] "string" [[d:][path]filespec ...]
FOR [%]%variable IN (set) DO command (see ~BATCH~)
~FORMAT~ [d:] [/1][/4][/8][/B][/N:# /T:#][/S][/V]
GOTO label (see ~BATCH~)
~GRAFTABL~ [{ 437 | 860 | 863 | 865 }] [/STATUS]
~GRAPHICS~ [COLOR{1|4|8} | COMPACT | GRAPHICS | THERMAL] [/B]
[/C] [/LCD] [/P port] [/R]
IF [NOT] condition command (see ~BATCH~)
~JOIN~ [d:] { [d:[directory]] | [/D] }
~KEYB~ kbcode[,[codepage][,d:[path]filespec]]
~LABEL~ [d:][label]
*LH [d:]path
*LOADHIGH [d:]path
~MKDIR~ [d:]path
~MODE~ LPT#[:]=COM#
MODE LPT#[:] [width][,[lpi][,P]]
MODE COM#[:]baud[,[parity][,[databits][,[stopbits][,P]]]]
MODE vmode [[,shiftmode][,T]]
MODE device CODEPAGE PREPARE = ((cpage)[d:][path]filespec)
MODE device CODEPAGE SELECT = cpage
MODE device CODEPAGE REFRESH
MODE device CODEPAGE /STATUS
~MORE~ [< d:[filespec]]
~NLSFUNC~ [d:][path]filespec
~PATH~ [=][[d:]dir [[;[d:]dir]...]]
PAUSE [text] (see ~BATCH~)
~PRINT~ [d:][path][filespec]... [/B:bsize][/C][/D:device]
[/M:maxtik][/P][/Q:nfiles][/S:tslice][/T][/U:busytik]
~PROMPT~ string
~RD~ [d:]path
~RECOVER~ [d:][path][filespec]
REM [text] (see ~BATCH~)
~REN~ [d:][path]oldname newname
~RENAME~ [d:][path]oldname newname
~REPLACE~ [d:][path]filespec [d:][path] [/A][/D][/P][/R][/S][/W]
~RESTORE~ d:[path][filespec] d: [/A] [/B:date]
{[/E:time] | [/L:time]} [/M][/N][/S]
~RMDIR~ [d:]path
~SELECT~ [[d:] [d:][path]]] country keyboard
*SET [name=[string]]
~SETVER~ [d:]
SETVER [d:][path]filespec n.nn
SETVER [d:][path]filespec /DELETE [/QUIET]
~SHARE~ [/F:size][/L:locks]
SHIFT (see ~BATCH~)
~SORT~ [/R] [/+column]
~SUBST~ [d: [[d:]path] [/D]]
~SYS~ d:
~TIME~ [hh:mm[:ss[.hun]]]
~TREE~ [d:] [/F]
~TRUENAME~ [filespec | path] (undocumented DOS 4.01+)
*TYPE [d:][path]filespec
*VER
*VERIFY [ON | OFF]
*VOL [d:]
~XCOPY~ [d:][path][srcspec] [d:][path][destspec] [/A][/D:mm-dd-yy]
[/E][/M][/P][/S][/V][/W]
* command is not listed in HelpPC
{} indicates one of the choices must be selected
[] optional
:config.sys
^DOS - CONFIG.SYS Statements and Common Device Drivers
^Standard Statements
BREAK = {ON|OFF} default=OFF
BUFFERS = n default=2 (3 for AT) range=[1..99]
COUNTRY = countrycode[,[codepage],[[d:][path]COUNTRY.SYS]] (DOS 2.1+)
DEVICE = [d:][path]filespec[.ext] [options]
DRIVPARM = /D:n [/C] [/F:n] [/H:n] [/N] [/S:n] [/T:n]
FCBS = m,n default=4,0 range=[1..255],[0..255]
FILES = n default=8 range=[8..255]
LASTDRIVE = d default=E range=[A..Z]
SHELL = [d:][path]filespec[.ext] [options]
STACKS = n,s default=9,128 range=[8..64],[32..512]
SWITCHCHAR =
^Device Drivers
DEVICE = ANSI.SYS
DEVICE = DISPLAY.SYS CON=(displaytype[,codepage],ncodepages)
DEVICE = DRIVER.SYS /D:ddd [/C][/F:f][/H:hh][/N][/S:ss][/T:ttt]
DEVICE = PRINTER.SYS port=(printertype[,codepage],ncodepages)
DEVICE = RAMDRIVE.SYS [size] [sector] [dir] [/A|/E] (DOS 3.2+)
DEVICE = VDISK.SYS [d:][path]vdisk.sys [comment] [size]
[comment] [sector] [comment] [dir] [/E[:{1..8}]]
:append
^DOS APPEND Command
% APPEND [path]
- external, available since DOS 3.2 (also in some OEM 3.1 versions)
- a TSR program that sets or displays the search path for data files
- network drives are legal parameters
- if no parameter is supplied, the ~ASSIGN~'ed path list is displayed
- the semicolon can be used to separate multiple file paths
- a single semicolon cancels all ASSIGN'ed paths
- the program does not know whether the data file was in the expected
directory or in the APPEND path
- must be used before ASSIGN if the specified 'path' is in the DOS
program search path
- known to cause problems with some programs
:assign
^DOS ASSIGN Command
% ASSIGN [X[=]Y[...]] [/STATUS]
X physical drive
Y new logical drive to mapped to drive Y
/status display current assignments (DOS 5.0)
ASSIGN A=C redirects all access to drive A: to C:
- external, available since DOS 3.0 (some OEM versions since 2.0)
- a TSR program that assigns a drive alias by redirecting disk
requests for the specified drive to another drive
- if no parameters are entered, all assignments are cancelled
- colons aren't necessary in this command
- defeats the ~COPY~ commands built in check for file dest = source
- should be avoided if possible, since it hides disk structure
from programs; This includes ~BACKUP~, ~JOIN~, ~LABEL~, ~PRINT~,
~RESTORE~, and ~SUBST~ included with DOS
- ~DISKCOMP~, ~DISKCOPY~, ~FORMAT~ and ~SYS~ ignore drive reassignment
- use ~SUBST~ in DOS 3.1 and later
:attrib
^DOS ATTRIB Command
% ATTRIB [±A] [±H] [±R] [±S] [d:][path][filespec] [/S]
-A clear archive attribute (DOS 3.2+)
+A set archive attribute (DOS 3.2+)
-R clear read-only attribute
+R set read-only attribute
-S clear system attribute (after DOS 3.3)
+S set system attribute (after DOS 3.3)
-H clear hidden attribute (after DOS 3.3)
+H set hidden attribute (after DOS 3.3)
/S process files in subdirectories also (after DOS 3.3)
- external, available since DOS 3.0
- sets, clears or displays file attributes
- if no attributes are supplied, current attributes are displayed
- not network compatible
:backup
^DOS BACKUP Command
% BACKUP d:[path][filespec] d: [/A] [/D:mm-dd-yy]
% [/F] [/L] [/M] [/S] [/T:hh:mm:ss]
/A append to files already on backup disk
/D:mm-dd-yy backup files modified on or after specified date
/F format target disk if not already formatted (DOS 3.3+)
/L:name create log of disk # for each backed up file
/M backup only files modified since last backup (archive bit on)
/S backup files in current directory and its subdirectories
/T:hh:mm:ss backup modified on or after specified time (DOS 3.3+)
- sets errorlevel as follows:
0 normal completion
1 no files found to backup
2 some files not backed up due to files sharing conflicts
3 terminated by user
4 terminated due to error
- external, available since DOS 2.0
- don't use with a drive that is ~ASSIGN~'ed, ~SUBST~'ed or ~JOIN~'ed
- preserves attribute bits
- if the destination is a floppy disk, it is erased first (unless
/A option is supplied)
- if a hard disk is the destination, the files are placed in a
directory named \BACKUP
- later version of BACKUP create files named BACKUPID.@@@ that
contain control information; see ~BACKUP FORMAT~
:chdir (dos):cd
^DOS CHDIR or CD Command
% CD [d:][path]dir
% CHDIR [d:][path]dir
- internal, available since DOS 2.0
- changes current directory to the specified directory; if path is
omitted the directory is changed to 'dir' in the current directory
- the fully qualified pathname must can't exceed 63 characters
:chkdsk
^DOS CHKDSK Command
% CHKDSK [pathname] [/F] [/V]
pathname is the name of a file or directory to check for fragmentation
/F fix errors in file system structure
/V verbose, display file names in each directory
- external, available since DOS 1.0
- reports on disk and memory statistics and disk problems
- attempts to fix file structure problems if the /F option is
supplied and structural damage is detected
- if a filename is specified, CHKDSK reports whether the file is
contiguous
- if lost cluster are found with /F option and the user chooses
to save them, files with the name FILEnnnn.CHK are created in
the root directory (/F)
- shouldn't be used on ~ASSIGN~'ed, ~JOIN~'ed, ~SUBST~'ed or
network drives
- checks for the following anomalies:
lost clusters (clusters allocated but not attached to a file)
cross linked clusters (multiple files claiming the same cluster)
invalid cluster numbers found in ~FAT~ chain
bad sectors located in FAT area
invalid first cluster number in directory entry
invalid file attributes in directory entry
directory structure damaged
:command.com
^DOS - COMMAND.COM - Command Interpreter
% COMMAND [device] [/C [d:][path]cmdstring][/E:size][/P]
device device to use for input and output (DOS 5.x)
/C passes command string to temporary command processor
/E:size sets environment size (see below) [160..32767]
/P makes command processor permanent
- external, available since DOS 1.0
- in DOS versions 2.0 through 3.1, size is indicated in paragraphs;
versions 3.2 and after indicate size in bytes
- "COMMAND/C string" is normally used in batch files to execute
other batch files and return
:comp
^PC-DOS COMP Command
% COMP [[d:][path]file1] [[d:][path]file2] [/A][/C][/D][/L][/N:nnn]
/D display differences in decimal
/A display differences in ASCII
/L display line number where difference occurred
/N:nnn compare only the first xxx lines
/C case insensitive
- external, available in PC DOS versions since 2.0
- compares the contents of two or more files; wildcards are allowed
- see ~FC~
:copy
^DOS COPY Command
% COPY source [/A][/B] [+source2[/A][/B]...] [dest] [/A][/B][/V]
/A preceding file is ASCII
/B preceding file is BINARY (copies ^Z if included in file)
/V verify data after writing to dest (no comparison is made)
- internal, available since DOS 1.0
- has minimal checking for destination being the same as the source
- if multiple files are specified with '+' they are appended to and
written to the destination
- to append to the destination the destination must be the first
filename in the source otherwise the data in the destination will
be lost
:ctty
^DOS CTTY Command
% CTTY device
- internal, available since DOS 2.0
- redirects standard input and output to specified character device
- device must be a character device (NUL and PRN shouldn't be used
since they are output only)
:date
^DOS DATE Command
% DATE [mm-dd-yy | mm/dd/yy | mm.dd.yy ]
mm month (1-12)
dd day (1-31)
yy year (80-99, 1980-1999) (1980-2079 DOS 3.0+)
- internal, available since DOS 1.0
- sets DOS date
- version 3.3 and later also update the ~CMOS~ setting if available
:dir
^DOS DIR Command
% DIR [d:][path][filename] [/P][/W]
/P pauses after each screen is displayed
/W displays file names 5 per line
- internal, available since DOS 1.0
:diskcomp
^DOS DISKCOMP Command
% DISKCOMP [drive1:] [drive2:] [/1] [/8]
/1 compare the first side of the diskette only
/8 compare the first eight sectors of each track only
- sets errorlevel as follows:
0 disks were identical
1 disks were different
2 program terminated by user
3 bad sector found in diskette
4 command syntax error, bad drive specification or not
enough memory
- external, available since DOS 2.0
- compares physical sectors of two diskettes
:diskcopy
^DOS DISKCOPY Command
% DISKCOPY [drive1:] [drive2:] [/1] [/v]
/1 Enables you to copy only one side of a disk.
/V Verifies that the contents of the disk are copied properly.
- sets errorlevel as follows:
0 disks copied successfully
1 recoverable disks error occurred
2 program terminated by user
3 unreadable sector in source or unformattable destination
4 command syntax error, bad drive specification or not
enough memory
- external, available since DOS 2.0
- copies source disk to destination sector by sector
- formats destination when necessary
:driver.sys
^DOS DRIVER.SYS Format
% device=[d:][path]DRIVER.SYS [/C][/D:#][/F:#][/H:#][/N][/S:#][/T:#]
/C changeline support required (AT and later)
/D:# drive number (0-255, 0=A, 1=B)
/F:# form factor
/H:# number of heads (1-99, default:2)
/N nonremovable media
/S:# sectors per track (1-99, default 9)
/T:# tracks per side (1-999, default 80)
- device driver, available since DOS 3.2
- older IBM AT's and AT clones often don't handle 3½ inch 720K drives
correctly. This is because when the BIOS in these machines detects
an 80 track disk it sets the data transfer rate to 500 KHz which
is too high for 720K disks.
:drivparm
^CONFIG.SYS DRIVPARM Statement
% DRIVPARM = /D:n [/C] [/F:n] [/H:n] [/N] [/S:n] [/T:n]
/D:n drive number n=[0..255] 0=A:, 1=B:, etc
/C drive supports door closed status support
/F:n form factor index (default is 2)
0 320K or 260K diskette
1 1.2Mb diskette
2 720K diskette
3 8 inch single density floppy
4 8 inch double density floppy
5 fixed disk
6 tape drive
7 other
/H:n number of heads n=[1..99]
/N indicates device is not removable
/S:n number of sectors per track n=[1..99]
/T:n number of tracks per side n=[1..999]
- sets block device parameters
:echo
^DOS ECHO Command
% ECHO [ON | OFF | msg]
ON turns command echo on in batch files (default)
OFF turns command echo off in batch files
msg message to write to the standard output
- internal, available since DOS 2.0
- displays text to standard output or sets batch echo mode
- if no parameters are supplied, it reports the echo state
- using "echo. " will output a blank line in most DOS versions
- DOS versions since 3.3 have the @ prefix available to disable
command echo for one command
:EMM.SYS:Intel EMS driver
^EMM.SYS Format
% device=emm.sys COMP IO_ADDR {1..16} [MEM_ADDR] [EXPF=x] [EXPL=x]
% [H=x] [MC] [MCF=x] [MCL=x] [ND] [NE] [NP] [RD] [VI]
:exe2bin
^DOS EXE2BIN Command
% EXE2BIN [d:][path]sourcefile [d:][path]destfile
- external, available since DOS 2.0
- converts .EXE files to .COM or .BIN files if the source meets the
following criteria: source file is a valid .EXE module, there is
no stack segment and the code size is less than 64K
:fc
^DOS FC Command
% FC file1 file2 [/A] [/B] [/C] [/L] [/LBn] [/N] [/nnnn] [/T] [/W]
/A abbreviate output for each differences (DOS 3.2)
/B binary compare (default for BIN, COM, EXE, LIB, OBJ, SYS)
/C case insensitive comparison
/L compare ascii files line by line
/LBn set internal buffer size to 'n' lines (default=100)
/N display the line numbers for ASCII comparisons (DOS 3.2)
/nnnn number of lines that must match to resynchronize (default is
3 lines, range=[1..9])
/T don't expand tabs in comparison (default=expand tabs, DOS 3.2)
/W ignore white space in comparisons
- external, available since DOS 2.0
- compares files and lists differences to standard output
:fcbs
^CONFIG.SYS FCBS Statement
% FCBS=m,p
m maximum number of files that can be opened via FCBS (default=4,
range=[1..255])
p number of FCBS that cannot be automatically closed by DOS
(default=0, range=[0..m])
- available since DOS 3.0
- SHARE increases the number of 'm' to 16 and 'p' to 8
:fdisk
^DOS FDISK Command
- external, available since DOS 3.2 (PC DOS since 2.0)
- menu driven interface manipulates disk partition table
- each hard disk may have up to 4 partitions
- deleting a partition makes data in that partition unrecoverable
- updates the disk partition table
:find
^DOS FIND Command
% FIND [/C] [/I] [/N] [/V] "string" [d:][path][filespec]
/C display count of lines containing "string"
/I case insensitive search (version specific)
/N display line numbers with each match
/V display lines not containing 'string'
- external, available since DOS 2.0
- searches for 'string' in a file or files
:format
^DOS FORMAT Command
% FORMAT [d:] [/1] [/4] [/8] [/B] [/N:#] [/Q] [/S] [/T:#] [/U] [/V]
d: drive to format
/1 format single sided 5¼ diskette
/4 format 360K diskette in 1.2Mb drive, unreliable on 360k drive
/8 format diskette with 8 sectors per track instead of 9/15
/B format diskette 8 sector per track, and reserve space for DOS
/F specifies size of floppy to format (DOS 5.x+)
/N:# specifies number of sectors per track, must be used with /T
/Q use quick format (DOS 5.x+)
/S copy DOS after format to make disk bootable
/T:# specifies number of tracks on disk, must be used with /N
/U format regardless, unconditional (DOS 5.x+)
/V format and prompt for volume label
- sets errorlevel as follows (DOS 3.2+):
0 format was successful
3 terminated by user
4 terminated due to error
5 terminated due to 'N' response to "Proceed with format prompt"
- external, available since DOS 1.0
- different OEM versions support different options
- completely erases all data on a floppy disk; resets root directory
and FAT on hard disks but leaves data intact, though inaccessible
- displays a warning if the target is a hard disk
:graftabl
^DOS GRAFTABL Command
% GRAFTABL [cp] [/STATUS]
cp code page identifier
/STATUS display the active code page
- external, available since DOS 3.0
- loads an extended graphics characters for characters 128-255 in
graphics mode
- this utility is a TSR that loads the character bitmaps into memory
and sets the ~INT 1F~ pointer to this bitmap table
- not necessary for PCjr or EGA systems
:graphics
^DOS GRAPHICS Command
% GRAPHICS [printer] [/B] [/C] [/D] [/F] [/P port] [/R]
/B print background in color (COLOR4 and COLOR8 printers only)
/C center printout on page
/F flip/rotate page 90 degrees
/LCD print image using LCD aspect ratio
/P port specifies printer port (1=LPT1, 2=LPT2, 3=LPT3)
/R print screen with black and white (same as on screen)
% Valid Printer Types
COLOR1 IBM PC Color Printer with black ribbon
COLOR4 IBM PC Color Printer with RGB ribbon
COLOR8 IBM PC Color Printer with CMY ribbon
COMPACT IBM PC Compact Printer
GRAPHICS IBM PC Graphics Printer (default)
- external, available since DOS 3.2 (PC DOS since 2.0)
- a TSR program that enables the PrtSc of a graphics display
- different versions of DOS have different parameters
- earlier versions were compatible with CGA modes only, later
versions handled enhanced video modes
- 640x200 graphics mode is printed with a 90 degree rotation
:join
^DOS JOIN Command
% JOIN [d1: [d2:]path] [/D]
d1: is the drive to add onto the subdirectory "d2:path"
d2:path is the subdirectory that will be used to reference "d1:"
/D cancels previous JOIN command
- external, available since DOS 3.0
- joins the root directory structure of a disk drive to a
subdirectory on another drive
- if no parameters are supplied, a list of current JOIN's is displayed
- "d1:" will no longer be available
- should not be used with drives that are ~SUBST~'ed or ~ASSIGN~'ed
- do not use ~BACKUP~, ~DISKCOMP~, ~DISKCOPY~, ~FORMAT~ and ~RESTORE~
with drives that are JOIN'ed
- network drives cannot be JOIN'ed
:keyb:keybdv:keybfr:keybgr:keybit:keybsp:keybuk
^DOS KEYB Command
% KEYB[xx]
% KEYB [cp],[[d:][path]filename]] [/ID:nnn]
xx is a two-letter country code
DV Dvorak keyboard
FR French keyboard
GR German keyboard
IT Italian keyboard
SP Spanish keyboard
UK United Kingdom keyboard
cp the code page for the desired character set
d:path the drive and directory where "filename" is located
filename the name of the keyboard definition file
nnn keyboard ID in use
- external, available since DOS 3.2 (PC DOS since 3.0)
- a TSR program that loads and replaces the ROM keyboard
translation table
- most commonly used to setup keyboards for use in countries other
than the US
- Ctrl-Alt-F1 returns the keyboard to the default configuration
- Ctrl-Alt-F2 returns the keyboard to the selected configuration
- implementation of this command varies between OEM DOS versions
:label
^DOS LABEL Command
% LABEL [d:] [label]
- external, available since DOS 3.1 (PC DOS since 3.0)
- adds, changes, or deletes the disk volume label
- DOS 2.x created labels with the ~FORMAT~ /V command
- should not be used with network, ~SUBST~'ed or ~ASSIGN~'ed drives
- though it is possible to create multiple labels via programming,
only one label should exist per drive
:mem (dos)
^DOS MEM Command
% MEM [/PROGRAM] [/DEBUG]
/PROGRAM displays names and segments of programs loaded in memory
/DEBUG displays names and segments of programs, internal drivers,
and other information
- external, available since DOS 4.0
- provides a description of memory similar to that of ~CHKDSK~ but
without checking the disk structure
:mkdir (dos):md
^DOS MKDIR or MD Command
% MD [d:][path]newdir
% MKDIR [d:][path]newdir
- internal, available since DOS 2.0
- creates new directory in the specified path or in the current
directory if no path is specified
- the fully qualified pathname must not exceed 63 characters
- should not be used to create directories on drives that have been
~ASSIGN~'ed, ~JOIN~'ed or ~SUBST~'ed.
:mode
^DOS MODE command
% MODE LPT#[:]=COM#
% MODE LPT#[:] [width][,[lpi][,P]]
width page print width (80 or 132, default:80)
lpi vertical spacing in lines per inch (6 or 8, default:6)
P continuous retry on time-out errors
% MODE COM#[:]baud[,[parity][,[databits][,[stopbits][,P]]]]
baud data baud rate (110,150,300,600,1200,2400,4800,4800,
9600 or 19200 (DOS 3.3), default:1200)
parity data parity (N=none, E=even, O=Odd, default:E)
databits number of data bits (7 or 8, default:7)
stopbits number of stop bits (1 or 2, default:1 (2 for 110 baud))
P continuous retry on time-out errors
% MODE vmode [,[shiftmode][,T]]
vmode:
40 set display width to 40 characters (color only)
80 set display width to 80 characters (color only)
BW40 set CGA display to 40 columns black and white (color only)
BW80 set CGA display to 80 columns black and white (color only)
CO40 set CGA display to 40 columns color (color only)
CO80 set CGA display to 80 columns color (color only)
MONO set display to MDA (monochrome only)
shiftmode:
R shift display one character to right (color only)
L shift display one character to left (color only)
T display test pattern (color only)
% MODE device CODEPAGE PREPARE = ((cpage)[d:][path]filespec)
% MODE device CODEPAGE SELECT = cpage
% MODE device CODEPAGE REFRESH
% MODE device CODEPAGE /STATUS
device device for codepage (CON, PRN, LPT#)
cpage code page number, or a list in parenthesis. Must
be one of the following: 437, 850, 860, 863, 865
/STATUS code page display status
- external, available since DOS 2.0
- codepage is applicable to DOS version 3.3 and higher
:more
^DOS MORE Command
% MORE [< filename]
- external, available since DOS 2.0
- displays text 23 lines at a time to the standard output device
- text is read from the standard input device; redirection is
normally used with this command
- Ctrl-Break and Ctrl-C are used to abort the display
:path
^DOS PATH Command
% PATH [=] [d:][path][;[d:][path]...]
- internal, available since DOS 2.0
- sets or displays DOS command search path
- multiple directory path names may be separated by semicolons ';'
:pause
^DOS PAUSE Command
% PAUSE [msg]
msg optional message to display as a prompt
- internal, available since DOS 1.0
- pauses display and waits for keystroke
- msg parameter not available in all DOS versions
:print
^DOS PRINT Command
% PRINT [d:][path][filespec]... [/B:bsize] [/C] [/D:device]
% [/M:maxtik] [/P] [/Q:nfiles] [/S:tslice] [/T] [/U:busytik]
/B:bsize internal buffer size; large 'bsize' improves performance
/C cancel all files included on command line (up to /P)
/D:device set print device; default is PRN
/M:maxtik max CPU ticks print can have; default=2 range={1..255}
/P set print mode (print files up to /C on command line)
/Q:nfiles max files allowed in queue; default=10 range={1..32}
/S:tslice CPU time slice value; default=8 range={1..255}
/T terminate all files printing and in queue
/U:busytik sets the number of ticks print waits for printer to
become available before giving up its time slice
- external, available since DOS 2.0
- this program is a TSR print spooler
- expands tabs (0x09) to spaces
- availability of options varies with DOS versions
:prompt
^DOS Prompt Command
% PROMPT string
"string" can be composed of any text combined with the following:
$_ CR/LF pair
$$ dollar sign
$b vertical slash symbol "│"
$d system date
$e escape character
$g greater than symbol ">"
$h destructive backspace
$l less than symbol "<"
$n current drive letter
$p current path name
$q equal symbol "="
$t current time
$v DOS version number
- internal, available since DOS 2.0
- see ~ANSI~
:recover
^DOS Recover Command
% RECOVER d:[path][filename]
- attempts to rebuilds files from a disk with a damaged directory
or bad sectors
- this command isn't as capable as programs like Norton Utilities or
PC Tools and should be used as a last resort
:ren:rename (DOS)
^DOS RENAME Command
% REN [d:][path]oldname newname
% RENAME [d:][path]oldname newname
- internal, available since DOS 1.0
- renames file 'oldname' to 'newname'
:replace
^DOS Replace Command
% REPLACE [d:][path]filespec [d:][path] [/A][/D][/P][/R][/S][/U][/W]
/A adds files to destination instead of replacing (mutually
exclusive with options /D and /S)
/D only transfer files with more recent dates than the destination
files (mutually exclusive with /A)
/P prompts before replacing
/R replace read only files also
/S search subdirectories; incompatible with /A option
/U replace files that are older than those in the source directory
/W prompt for diskette before beginning operation
- external, available since DOS 3.2
:restore
^DOS RESTORE Command
% RESTORE d:[path][filespec] d: [/A] [/B:mm-dd-yy]
% [/E:hh:mm] [/L:hh:mm] [/M] [/N] [/P] [/S]
/A:mm-dd-yy restore files modified on or after date specified
/B:mm-dd-yy restore files modified on or before date specified
/D:mm-dd-yy restore files modified on or before specified date
/E:hh:mm restore files modified on or after specified time
/L:hh:mm restore files modified on or before specified time
/M restore files modified or deleted since last backup
/N restore files that no longer exist on target
/P prompt before restoring hidden, R/O or newer existing files
/S restore files to subdirectories also
- sets errorlevel as follows:
0 normal completion
1 no files found to restore
2 some files not restored due to files sharing conflicts
3 terminated by user
4 terminated due to error
- external, available since DOS 2.0
- all parameters except /P and /S are new in DOS 3.3
:rmdir (DOS):rd
^DOS RMDIR or RD Command
% RD [d:][path]dir
% RMDIR [d:][path]dir
- internal, available since DOS 2.0
- deletes directory 'dir' in the specified path or in the current
directory if no path is specified
- the fully qualified pathname must not exceed 63 characters
- should not be used to remove directories on drives that have been
~ASSIGN~'ed, ~JOIN~'ed or ~SUBST~'ed.
:select
^DOS SELECT Command
% SELECT [[d1:] d2:[path]] country keyboard
d1: is the floppy disk (A: or B:) containing DOS system files
d2:[path] disk/directory to receive the system files & country info
country is a three digit code from the table below
keyboard is a two character string from the table below
% Country Keyboard
% Country Code Code
Arabic 785
Australia 061 US
Belgium 032 BE
Canada (English) 001 US
Canada (French) 002 CF
Denmark 045 DK
Finland 358 SU
France 033 FR
Germany 049 GR
Hebrew 972
Italy 039 IT
Latin America 003 LA
Netherlands 031 NL
Norway 047 NO
Portugal 351 PO
Spain 034 SP
Sweden 046 SV
Switzerland (French) 041 SF
Switzerland (German) 041 SF
United Kingdom 044 UK
United States 001 US
- external, available since DOS 4.0 (PC DOS since 3.0)
- configures system for specific country
- uses ~DISKCOPY~, ~FORMAT~ and ~XCOPY~ utilities
:setver
^DOS - SETVER Command
% SETVER [d:]
% SETVER [d:]filespec n.nn
% SETVER [d:]filespec /DELETE [/QUIET]
d: Drive containing DOS system files (boot disk).
filespec program filename
n.nn version to be reported when DOS loads program
/DELETE delete the SETVER entry for "filespec"
/QUIET do not display message when deleting VERSION
- external, available since DOS 5.0
- sets the version number reported to a program when DOS loads
the application
:share
^DOS SHARE Program
% SHARE [/F:size] [/L:locks]
/F allocates 'size' bytes for file sharing information (default
is 2048 bytes)
/L configures the number of file regions that can be locked at
one time (default is 20)
- external, available since DOS 3.0
- a TSR that installs file sharing and locking for network
environments
- for large media in DOS versions 4.0 through DOS 4.01 (Compaq
DOS 3.31) this command must be issued to enable extended FCB
support; otherwise a the older ~FCB~ function calls could destroy
critical disk data
:sort
^DOS SORT Command
% SORT [/R] [/+n]
/R reverse or descending sort order
/+n sort file starting at column 'n'
- external, available since DOS 2.0
- a filter that sorts an ASCII file provided via the standard input
device and writes output to the standard output devices
- DOS version 3.0+ perform case insensitive sorts, previous versions
were case sensitive
- DOS version 3.0+ treat foreign accented symbols as their english
counterparts if the country settings
:stacks
^CONFIG.SYS STACKS Statement
% STACKS = n,s
n number of stacks to use (default=9, range=[8..64])
s each stack size in bytes (default=128, range=[32..512])
- available since DOS 3.2
- DOS version 3.2 and began switching to internal stacks before
servicing interrupts 02h, 08h-0Eh, 70h and 72h-77h. This was to
protect applications from stack overflow during nested hardware
interrupt handling.
- STACKS=0,0 disables DOS's stack handling
:subst
^DOS SUBST Command
% SUBST [d1: [d2:]path] [/D]
d1: drive to reference "path" through
d2: drive containing the directory
path directory pointed to by "d1:"
/D deletes a substituted drive
- external, available since DOS 3.1
- substitutes a drive letter for a pathname
- should be avoided if possible, since it hides disk structure
from programs; this includes ~BACKUP~, ~CHKDSK~, ~DISKCOMP~,
~DISKCOPY~, ~FDISK~, ~FORMAT~, ~JOIN~, ~LABEL~ and ~RESTORE~
commands and SUBST included with DOS
- ~CHDIR~, ~MKDIR~, ~PATH~ and ~RMDIR~ commands should be used
with caution if a SUBST'ed drive is used as a parameter
- network drives cannot be SUBST'ed
:sys
^DOS SYS Command
% SYS d:
d: is the drive to receive the system
- external, available since DOS 1.0
- transfers hidden system files IBMBIO.COM and IBMDOS.COM (IO.SYS
and MSDOS.SYS for MS-DOS) from one disk to another making the
disk capable of being booted (must copy COMMAND.COM first)
- should not be used on network drives
:time (DOS)
^DOS TIME Command
% TIME [ hh:mm:[ss[:nn]] ]
hh hours (0-23)
mm minutes (0-59)
ss seconds (0-59)
nn hundredths (0-99)
- internal, available since DOS 1.0
- sets DOS time
- version 3.3 and later also update the ~CMOS~ setting if available
:tree
^DOS TREE Command
% TREE [d:] [/F] [/A]
/F displays files in each directory also
/A use ASCII characters instead of graphics characters in diagram
- external, available since DOS 3.2 (PC DOS since 2.0)
- displays the directory tree of a drive or directory
- PC DOS version before 3.1 did not display filenames in the root
directory when /F was specified
:truename
^DOS TRUENAME Command (undocumented)
% TRUENAME [filespec | path]
Returns the filename or pathname fully qualified even if the file
has been ~SUBST~'ed or ~JOIN~'ed. If no parm is specified it returns
the fully qualified current directory.
- internal, available since DOS 4.01
:xcopy
^DOS XCOPY Command
% XCOPY [d:][path][srcspec] [d:][path][destspec]
% [/A] [/D:date] [/E] [/M] [/P] [/S] [/V] [/W]
/A copy only files with archive bit set, no attribute changes
/D:date copy only files with dates the same or newer than 'date'
/E duplicate empty subdirectories on destination
/M copy only files with archive bit set, clears archive bit
/P prompt before copying file
/S include all child subdirectories
/V verify writes to destination
/W wait and prompt for disk before beginning copy
- external, available since DOS 3.2
:.BAT:Batch Commands
^Batch File Commands
% ECHO [ON | OFF] text
Turns echoing of batch file commands on or off. DOS is normally
in the ON state. ECHO without any parameters will display the
current ECHO state. If a text message is supplied as a parameter
the message is written to the console. To display a blank line,
use the following: ECHO. (ECHO followed immediately by a period).
% FOR %%var IN (set) DO command
The FOR command allows repetitive execution of DOS commands. For
each iteration, "%%var" is replaced with an element of "set" and the
command is executed. Wildcards and paths are allowed as elements of
"set" and represent any matching file names. FOR commands cannot
be nested. To use FOR from the command line, only one "%" is
necessary. Example:
FOR %%f IN (*.c) touch %%f
will set the date and time of all files with the extension ".C".
% GOTO label
Causes batch file execution to transfer control to the line
following the specified label. A label is case insensitive,
significant up to 8 characters and must be preceded by a colon
on the line where it is defined. The GOTO statement does NOT
require a colon though. If the specified label isn't found,
batch file execution halts and the "Label not found" error is
displayed.
% IF [NOT] ERRORLEVEL number command
% IF [NOT] EXIST [d:][path]filename command
% IF [NOT] var1 == var2 command
Provides a primitive conditional execution facility for batch files.
If the condition is TRUE, the command is executed. If false, the
batch file continues at the next line. The NOT parameter negates
the condition.
In the ERRORLEVEL test, "command" is executed if the ERRORLEVEL
(return code of previous program) is "number" or higher.
The second form of the IF statement tests for the existence of a file
or group of files (if wild cards are used) and executes "command"
if found. It cannot check for the existence of a subdirectory.
The third IF test uses text variables. These variables are case
sensitive and must be at least 1 character long. If the parameter
may result in a null string, the variables should be quoted or
pre/post-pended with another character. Here's an example:
IF "%1" == "" GOTO null
IF "%1" == "y" GOTO yes
IF "%1" == "Y" GOTO yes
:YES
:NULL
% PAUSE [text]
BATCH file execution is halted and a prompt for a key is displayed.
If a line of text is supplied the text is echoed to the display,
followed by the prompt. Prompts vary with DOS version.
% REM [text]
Displays "text" to the console if ECHO is ON. Usually used to
document batch files. Similar to the ECHO command but can be
disabled by turning ECHO off.
% SHIFT
Shifts the data in the BATCH file replaceable parameters from
higher number parameters to lower number parameters. Example:
if TEST.BAT contains the following lines:
echo "%0 %1 %2 %3 %4 %5"
shift
echo "%0 %1 %2 %3 %4 %5"
shift
echo "%0 %1 %2 %3 %4 %5"
shift
echo "%0 %1 %2 %3 %4 %5"
and TEST.BAT is called with the following command line:
test abc def ghi jkl mno
the following would be displayed:
"test abc def ghi jkl mno"
"abc def ghi jkl mno "
"def ghi jkl mno "
"ghi jkl mno "
- all the batch file commands listed here are internal
- if < > or | are found in REM or ECHO statements, the text
information supplied is redirected/piped.