Windows 95 Commands
Native Windows 95 Commands
Internal commands
Start
à RunThen enter "command"
External commands
Where to get help on Windows commands?
Enter "HELP" at the MS-DOS command prompt. You will see the following commands and batch commands:
Use the scroll bars to see more commands. Or, press the PAGE DOWN key. For more information about using MS-DOS Help, choose How to Use MS-DOS Help from the Help menu, or press F1. To exit MS-DOS Help, press ALT, F, X.
<What's New in MS-DOS 6.22?>
<ANSI.SYS> <EMM386.EXE> <Multi-config>
<Append> <Erase> <Nlsfunc>
<Attrib> <Exit> <Numlock>
<Batch commands> <Expand> <Path>
<Break> <Fasthelp> <Pause>
<Buffers> <Fastopen> <Power>
<Call> <Fc> <POWER.EXE>
<Cd> <Fcbs> <Print>
<Chcp> <Fdisk> <Prompt>
<Chdir> <Files> <Qbasic>
<Chkdsk> <Find> <RAMDRIVE.SYS>
<CHKSTATE.SYS> <For> <Rd>
<Choice> <Format> <Rem>
<Cls> <Goto> <Ren>
<Command> <Graphics> <Rename>
<CONFIG.SYS commands> <Help> <Replace>
<Copy> <HIMEM.SYS> <Restore>
<Country> <If> <Rmdir>
<Ctty> <Include> <ScanDisk>
<Date> <Install> <Set>
<Dblspace> <Interlnk> <Setver>
<Debug> <INTERLNK.EXE> <SETVER.EXE>
<Defrag> <International commands> <Share>
<Del> <Intersvr> <Shell>
<Deltree> <Keyb> <Shift>
<Device> <Label> <SIZER.EXE>
<Device drivers> <Lastdrive> <Smartdrv>
<Devicehigh> <Lh> <SMARTDRV.EXE>
<Dir> <Loadfix> <Sort>
<Diskcomp> <Loadhigh> <Stacks>
<Diskcopy> <Md> <Submenu>
<DISPLAY.SYS> <Mem> <Subst>
<Dos> <Memmaker> <Switches>
<Doskey> <MenuColor> <Sys>
<Dosshell> <MenuDefault> <Time>
<DRIVER.SYS> <MenuItem> <Tree>
<Drivparm> <Mkdir> <Type>
<Drvspace> <Mode Commands> <Undelete>
<Drvspace Tips> <More> <Unformat>
<DRVSPACE.SYS> <Move> <Ver>
Batch Commands
A batch file or batch program is an unformatted text file that contains one or more MS-DOS commands and is assigned a .BAT extension. When you type the name of the batch program at the command prompt, the commands are carried out as a group.
Any MS-DOS command you use at the command prompt can also be put in a batch program. In addition, the following MS-DOS commands are specially designed for batch programs:
<Call> <If>
<Choice> <Pause>
<Echo> <Rem>
<For> <Shift>
<Goto>
You can use the COMMAND /Y command to step through a batch program line by line, and can selectively bypass or carry out individual commands. This is useful for tracking down problems in batch files. For more information, see
<COMMAND>.
Syntax of Internal Commands
break
Sets or clears extended CTRL+C checking.
BREAK [ON | OFF]
Type BREAK without a parameter to display the current BREAK setting.
cd
CHDIR[..]
CD [drive:][path]
CD[..]
.. Specifies that you want to change to the parent directory.
Type CD drive: to display the current directory in the specified drive.
Type CD without parameters to display the current drive and directory.
chcp
Displays or sets the active code page number.
CHCP [nnn]
nnn Specifies a code page number.
Type CHCP without a parameter to display the active code page number.
chdir
See the cd command.
cls
Clears the screen.
copy
Copies one or more files to another location.
COPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination
[/A | /B]] [/V] [/Y | /-Y]
source Specifies the file or files to be copied.
/A Indicates an ASCII text file.
/B Indicates a binary file.
destination Specifies the directory and/or filename for the new file(s).
/V Verifies that new files are written correctly.
/Y Suppresses prompting to confirm you want to overwrite an
existing destination file.
/-Y Causes prompting to confirm you want to overwrite an
existing destination file.
The switch /Y may be preset in the COPYCMD environment variable.
This may be overridden with /-Y on the command line
To append files, specify a single file for destination, but multiple files
for source (using wildcards or file1+file2+file3 format).
ctty
Changes the terminal device used to control your system.
CTTY device
device The terminal device you want to use, such as COM1.
date
Displays or sets the date.
DATE [date]
Type DATE without parameters to display the current date setting and
a prompt for a new one. Press ENTER to keep the same date.
dir
Displays a list of files and subdirectories in a directory.
DIR [drive:][path][filename] [/P] [/W] [/A[[:]attributes]]
[/O[[:]sortorder]] [/S] [/B] [/L] [/V]
[drive:][path][filename]
Specifies drive, directory, and/or files to list.
(Could be enhanced file specification or multiple filespecs.)
/P Pauses after each screenful of information.
/W Uses wide list format.
/A Displays files with specified attributes.
attributes D Directories R Read-only files
H Hidden files A Files ready for archiving
S System files - Prefix meaning not
/O List by files in sorted order.
sortorder N By name (alphabetic) S By size (smallest first)
E By extension (alphabetic) D By date & time (earliest first)
G Group directories first - Prefix to reverse order
A By Last Access Date (earliest first)
/S Displays files in specified directory and all subdirectories.
/B Uses bare format (no heading information or summary).
/L Uses lowercase.
/V Verbose mode.
Switches may be preset in the DIRCMD environment variable. Override
preset switches by prefixing any switch with - (hyphen)--for example, /-W.
del
Deletes one or more files.
DEL [drive:][path]filename [/P]
ERASE [drive:][path]filename [/P]
[drive:][path]filename Specifies the file(s) to delete. Specify multiple
files by using wildcards.
/P Prompts for confirmation before deleting each file.
erase
Deletes one or more files.
DEL [drive:][path]filename [/P]
ERASE [drive:][path]filename [/P]
[drive:][path]filename Specifies the file(s) to delete. Specify multiple
files by using wildcards.
/P Prompts for confirmation before deleting each file.
exit
Quits the COMMAND.COM program (command interpreter).
EXIT
loadhigh (lh)
Loads a program into the upper memory area.
LOADHIGH [drive:][path]filename [parameters]
LOADHIGH [/L:region1[,minsize1][;region2[,minsize2]...] [/S]]
[drive:][path]filename [parameters]
/L:region1[,minsize1][;region2[,minsize2]]...
Specifies the region(s) of memory into which to load
the program. Region1 specifies the number of the first
memory region; minsize1 specifies the minimum size, if
any, for region1. Region2 and minsize2 specify the
number and minimum size of the second region, if any.
You can specify as many regions as you want.
/S Shrinks a UMB to its minimum size while the program
is loading.
[drive:][path]filename
Specifies the location and name of the program.
md
Creates a directory.
MKDIR [drive:]path
MD [drive:]path
mkdir
See md command.
more
Displays output one screen at a time.
MORE [drive:][path]filename
MORE < [drive:][path]filename
command-name | MORE [drive:][path][filename]
[drive:][path]filename Specifies file(s) to display one screen at a time
command-name Specifies a command whose output will be displayed.
path
Displays or sets a search path for executable files.
PATH [[drive:]path[;...]]
PATH ;
Type PATH ; to clear all search-path settings and direct Windows to search
only in the current directory.
Type PATH without parameters to display the current path.
prompt
Changes the Windows command prompt.
PROMPT [text]
text Specifies a new command prompt.
Prompt can be made up of normal characters and the following special codes:
$Q = (equal sign)
$$ $ (dollar sign)
$T Current time
$D Current date
$P Current drive and path
$V Windows version number
$N Current drive
$G > (greater-than sign)
$L < (less-than sign)
$B | (pipe)
$H Backspace (erases previous character)
$E Escape code (ASCII code 27)
$_ Carriage return and linefeed
Type PROMPT without parameters to reset the prompt to the default setting.
rd
Removes (deletes) a directory.
RMDIR [drive:]path
RD [drive:]path
ren
Renames a file/directory or files/directories.
RENAME [drive:][path][directoryname1 | filename1] [directoryname2 | filename2]
REN [drive:][path][directoryname1 | filename1] [directoryname2 | filename2]
Note that you cannot specify a new drive or path for your destination.
rename
See the ren command
rmdir
Removes (deletes) a directory.
RMDIR [drive:]path
RD [drive:]path
set
Displays, sets, or removes Windows environment variables.
SET [variable=[string]]
variable Specifies the environment-variable name.
string Specifies a series of characters to assign to the variable.
Type SET without parameters to display the current environment variables.
time
Displays or sets the system time.
TIME [time]
Type TIME with no parameters to display the current time setting and a prompt
for a new one. Press ENTER to keep the same time.
type
Displays the contents of text files.
TYPE [drive:][path]filename
ver
Displays the Windows version.
VER
verify
Tells Windows whether to verify that your files are written correctly to a
disk.
VERIFY [ON | OFF]
Type VERIFY without a parameter to display the current VERIFY setting.
vol
Displays the disk volume label and serial number, if they exist.
VOL [drive:]
Syntax of External Commands
attrib
Displays or changes file attributes.
ATTRIB [+R | -R] [+A | -A] [+S | -S] [+H | -H] [[drive:][path]filename] [/S]
+ Sets an attribute.
- Clears an attribute.
R Read-only file attribute.
A Archive file attribute.
S System file attribute.
H Hidden file attribute.
/S Processes files in all directories in the specified path.
chkdsk
Checks a disk and displays a status report.
CHKDSK [drive:][[path]filename] [/F] [/V]
[drive:][path] Specifies the drive and directory to check.
filename Specifies the file(s) to check for fragmentation.
/F Fixes errors on the disk.
/V Displays the full path and name of every file on the disk.
Type CHKDSK without parameters to check the current disk.
Instead of using CHKDSK, try using SCANDISK. SCANDISK can reliably detect
and fix a much wider range of disk problems.
command
drvspace
Compresses hard disk drives or floppy disks, and configures drives that were compressed by using DriveSpace.
This is a Window-based utility. For information, use HELP DRVSPACE to see the syntax description.
debug
Runs Debug, a program testing and editing tool.
DEBUG [[drive:][path]filename [testfile-parameters]]
[drive:][path]filename Specifies the file you want to test.
testfile-parameters Specifies command-line information required by
the file you want to test.
After Debug starts, type ? to display a list of debugging commands.
defrag
This is a Window-based utility. For information, use HELP DEFRAG to see the syntax description.
Reorganizes the files on a disk to optimize disk performance. Do not use
this command when Windows is running.
DEFRAG--Example
To load DEFRAG into conventional memory and specify that DEFRAG sort files
according to the date they were created, from latest created to earliest
created, type the following command:
defrag c: /f /sd- /skiphigh
This example fully optimizes drive C, but slows DEFRAG.
deltree
Deletes a directory and all the subdirectories and files in it.
To delete one or more files and directories:
DELTREE [/Y] [drive:]path [[drive:]path[...]]
/Y Suppresses prompting to confirm you want to delete
the subdirectory.
[drive:]path Specifies the name of the directory you want to delete.
Note: Use DELTREE cautiously. Every file and subdirectory within the
specified directory will be deleted.
diskcopy
Copies the contents of one floppy disk to another.
DISKCOPY [drive1: [drive2:]] [/1] [/V] [/M]
/1 Copies only the first side of the disk.
/V Verifies that the information is copied correctly.
/M Force multi-pass copy using memory only.
The two floppy disks must be the same type.
You may specify the same drive for drive1 and drive2.
edit
MS-DOS Editor Version 2.0.026 Copyright (c) Microsoft Corp 1995.
EDIT [/B] [/H] [/R] [/S] [/<nnn>] [/?] [file(s)]
/B - Forces monochrome mode.
/H - Displays the maximum number of lines possible for your hardware.
/R - Load file(s) in read-only mode.
/S - Forces the use of short filenames.
/<nnn> - Load binary file(s), wrapping lines to <nnn> characters wide.
/? - Displays this help screen.
[file] - Specifies initial files(s) to load. Wildcards and multiple
filespecs can be given.
emm386
Turns on or off EMM386 expanded memory support.
EMM386 [ON | OFF | AUTO] [W=ON | W=OFF]
ON | OFF | AUTO Activates or suspends EMM386.EXE device driver,
or places it in auto mode.
W=ON | OFF Turns on or off Weitek coprocessor support.
expand
Expands one or more compressed files.
EXPAND [drive:][path]filename [[drive:][path]filename [...]] destination
[drive:][path]filename Specifies the location and/or name of a file
or set of files to be expanded. You cannot use
wildcards.
destination Specifies the new location and/or name of an
expanded file or set of files. Destination can
be a drive letter and colon, directory name,
filename, or combination.
The destination can only be a filename if you have specified a single
filename for the source filename parameter. To expand a file or set
of files to a different directory and keep the original filename(s),
specify only a directory as the destination.
fc
Compares two files or sets of files and displays the differences between
them.
FC [/A] [/C] [/L] [/LBn] [/N] [/T] [/W] [/nnnn] [drive1:][path1]filename1
[drive2:][path2]filename2
FC /B [drive1:][path1]filename1 [drive2:][path2]filename2
/A Displays only first and last lines for each set of differences.
/B Performs a binary comparison.
/C Disregards the case of letters.
/L Compares files as ASCII text.
/LBn Sets the maximum consecutive mismatches to the specified number of
lines.
/N Displays the line numbers on an ASCII comparison.
/T Does not expand tabs to spaces.
/W Compresses white space (tabs and spaces) for comparison.
/nnnn Specifies the number of consecutive lines that must match after a
mismatch.
fdisk
Starts the Fdisk program, which configures a hard disk for use with MS-DOS.
Fdisk displays a series of menus to help you partition your hard disk(s) for
MS-DOS.
Syntax
To start the Fdisk program, use the following syntax:
FDISK
To display partition information without starting the Fdisk program, use the
following syntax:
FDISK /STATUS
Switch
/STATUS
Displays an overview of the partition information of your computer's
hard disk(s), without starting the Fdisk program.
find
Searches for a text string in a file or files.
FIND [/V] [/C] [/N] [/I] "string" [[drive:][path]filename[ ...]]
/V Displays all lines NOT containing the specified string.
/C Displays only the count of lines containing the string.
/N Displays line numbers with the displayed lines.
/I Ignores the case of characters when searching for the string.
"string" Specifies the text string to find.
[drive:][path]filename
Specifies a file or files to search.
If a pathname is not specified, FIND searches the text typed at the prompt
or piped from another command.
format
Formats a disk for use with MS-DOS.
The FORMAT command creates a new root directory and file allocation table
for the disk. It can also check for bad areas on the disk, and it can delete
all data on the disk. In order for MS-DOS to be able to use a new disk, you
must first use this command to format the disk.
keyb
Configures a keyboard for a specific language.
KEYB [xx[,[yyy][,[drive:][path]filename]]] [/E] [/ID:nnn]
xx Specifies a two-letter keyboard code.
yyy Specifies the code page for the character set.
[drive:][path]filename Specifies the keyboard definition file.
/E Specifies that an enhanced keyboard is installed.
/ID:nnn Specifies the keyboard in use.
label
Creates, changes, or deletes the volume label of a disk.
LABEL [drive:][label]
loadfix
Loads a program above the first 64K of memory, and runs the program.
LOADFIX [drive:][path]filename
Use LOADFIX to load a program if you have received the message
"Packed file corrupt" when trying to load it in low memory.
mem
Displays the amount of used and free memory in your system.
MEM [/CLASSIFY | /DEBUG | /FREE | /MODULE modulename] [/PAGE]
/CLASSIFY or /C Classifies programs by memory usage. Lists the size of
programs, provides a summary of memory in use, and lists
largest memory block available.
/DEBUG or /D Displays status of all modules in memory, internal drivers,
and other information.
/FREE or /F Displays information about the amount of free memory left
in both conventional and upper memory.
/MODULE or /M Displays a detailed listing of a module's memory use.
This option must be followed by the name of a module,
optionally separated from /M by a colon.
/PAGE or /P Pauses after each screenful of information.
mode
Configures system devices.
Printer port: MODE LPTn[:] [COLS=c] [LINES=l] [RETRY=r]
Serial port: MODE COMm[:] [BAUD=b] [PARITY=p] [DATA=d] [STOP=s] [RETRY=r]
Device Status: MODE [device] [/STATUS]
Redirect printing: MODE LPTn[:]=COMm[:]
Prepare code page: MODE device CP PREPARE=((yyy[...]) [drive:][path]filename)
Select code page: MODE device CP SELECT=yyy
Refresh code page: MODE device CP REFRESH
Code page status: MODE device CP [/STATUS]
Display mode: MODE [display-adapter][,n]
MODE CON[:] [COLS=c] [LINES=n]
Typematic rate: MODE CON[:] [RATE=r DELAY=d]
move
Moves files and renames files and directories.
To move one or more files:
MOVE [/Y | /-Y] [drive:][path]filename1[,...] destination
To rename a directory:
MOVE [/Y | /-Y] [drive:][path]dirname1 dirname2
[drive:][path]filename1 Specifies the location and name of the file or files you want to move.
destination Specifies the new location of the file. Destination can consist of a drive letter and colon, a directory name, or a combination. If you are moving only one file, you can also include a filename if you want to rename the file when you move it.
[drive:][path]dirname1 Specifies the directory you want to rename.
Dirname1 Specifies the new name of the directory.
/Y Suppresses prompting to confirm creation of a directory or overwriting of the destination.
/-Y Causes prompting to confirm creation of a directory or overwriting of the destination.
The switch /Y may be present in the COPYCMD environment variable.
This may be overridden with /-Y on the command line.
nlsfunc
Loads country-specific information.
NLSFUNC [[drive:][path]filename]
[drive:][path]filename Specifies the file containing country-specific information.
scandisk
For information about the command-line parameters supported by
ScanDisk for Windows, look up 'checking for errors, in disks' in
the Windows Help index. Then view the topic 'Checking your disk
for errors every time your computer starts.'
setver
Sets the MS-DOS version number that Windows reports to a program.
Display current version table: SETVER [drive:path]
Add entry: SETVER [drive:path] filename n.nn
Delete entry: SETVER [drive:path] filename /DELETE [/QUIET]
[drive:path] Specifies location of the SETVER.EXE file.
filename Specifies the filename of the program.
n.nn Specifies the MS-DOS version to be reported to the program.
/DELETE or /D Deletes the version-table entry for the specified program.
/QUIET or /Q Hides the message typically displayed during deletion of
version-table entry.
smartdrv
** Under Windows 95/98, do not place this command in AUTOEXEC.BAT. Windows 95 uses another method of disk caching.
sort
Sorts input and writes results to the screen, a file, or another device
SORT [/R] [/+n] [[drive1:][path1]filename1] [> [drive2:][path2]filename2]
[command |] SORT [/R] [/+n] [> [drive2:][path2]filename2]
/R Reverses the sort order; that is, sorts Z to A,
then 9 to 0.
/+n Sorts the file according to characters in
column n.
[drive1:][path1]filename1 Specifies file(s) to be sorted
[drive2:][path2]filename2 Specifies a file where the sorted input is to be
stored.
command Specifies a command whose output is to be sorted.
start/W
Runs a Windows program or an MS-DOS program.
START [options] program [arg...]
START [options] document.ext
/m[inimized] Run the new program minimized (in the background).
/max[imized] Run the new program maximized (in the foreground).
/r[estored] Run the new program restored (in the foreground). [default]
/w[ait] Does not return until the other program exits.
subst
Associates a path with a drive letter.
SUBST [drive1: [drive2:]path]
SUBST drive1: /D
drive1: Specifies a virtual drive to which you want to assign a path.
[drive2:]path Specifies a physical drive and path you want to assign to
a virtual drive.
/D Deletes a substituted (virtual) drive.
Type SUBST with no parameters to display a list of current virtual drives.
xcopy
Copies files and directory trees.
XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/W]
[/C] [/I] [/Q] [/F] [/L] [/H] [/R] [/T] [/U]
[/K] [/N]
source Specifies the file(s) to copy.
destination Specifies the location and/or name of new files.
/A Copies files with the archive attribute set,
doesn't change the attribute.
/M Copies files with the archive attribute set,
turns off the archive attribute.
/D:date Copies files changed on or after the specified date.
If no date is given, copies only those files whose
source time is newer than the destination time.
/P Prompts you before creating each destination file.
/S Copies directories and subdirectories except empty ones.
/E Copies directories and subdirectories, including empty ones.
Same as /S /E. May be used to modify /T.
/W Prompts you to press a key before copying.
/C Continues copying even if errors occur.
/I If destination does not exist and copying more than one file,
assumes that destination must be a directory.
/P Prompts you before creating each destination file.
/S Copies directories and subdirectories except empty ones.
/E Copies directories and subdirectories, including empty ones.
Same as /S /E. May be used to modify /T.
/W Prompts you to press a key before copying.
/C Continues copying even if errors occur.
/I If destination does not exist and copying more than one file,
assumes that destination must be a directory.
-- More --
/Q Does not display file names while copying.
/F Displays full source and destination file names while copying.
/L Displays files that would be copied.
/H Copies hidden and system files also.
/R Overwrites read-only files.
/T Creates directory structure, but does not copy files. Does not
include empty directories or subdirectories. /T /E includes
empty directories and subdirectories.
/U Updates the files that already exist in destination.
/K Copies attributes. Normal Xcopy will reset read-only attributes.
/Y Overwrites existing files without prompting.
/-Y Prompts you before overwriting existing files.