0% found this document useful (0 votes)
178 views168 pages

Olivetti - MS-DOS 3.30 - User Guide

Olivetti - MS-DOS 3.30 - User Guide

Uploaded by

robert
Copyright
© © All Rights Reserved
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)
178 views168 pages

Olivetti - MS-DOS 3.30 - User Guide

Olivetti - MS-DOS 3.30 - User Guide

Uploaded by

robert
Copyright
© © All Rights Reserved
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/ 168

Operating Systems and Languages Library

MS·DOS
User Guide

PERSONAL
COMPUTER

111111111
PUBLICATION ISSUED BY:

Ing . C. Olivetti & C., S.pA


Direzione Documentazione
77, Via Jervis - 10015 Ivrea (Italy)

Copyright © Microsoft Corporation


1980-1986

Copyright © 1989, by Olivetti


All rights reserved

OLiVETII is a trademark of tng . C. Olivetti & C.. S.p.A.


Microsoft ' is a registered trademark of Microsoft Corp.
MS is a registered trademark of Microsoft Corp.
GW is a registerd trademark of Microsoft Corp.
Microsoft logo is a registered trademark of Microsoft Corp.
ETHERNET is a trademark of Xerox Corp.
UNIX is a trademark of AT&T
XENIX is a registered trademark of Microsoft Corp.
MS·DOS · is a registered trademark of Microsoft Corp.
MS-NET is a registered trademark of Microsoft Corp.
IBM is a registered trademark of International Business Machines Corp.
OLiNEHAN is a trademark of Ing. C. Olivetti & C., S.p.A.
LSX and X/OS are trademarks of Ing . C. Olivetti & C. , S.p.A.
Inte1386, 386, 386SX and 376 are trademarks of Intel Corp.
MCA is a registered trademark of International Business Machines Corp.

Information from
Olivetti Documentation
NOTICE

Ing. C. Olivetti & C. S.p.A. reserves the right to make any changes in
the product described in this manual at any time and without notice.

This manual is licensed to the Customer under the conditions contained


in the User License enclosed with the Program to which the manual
refers.
PREFACE

This manual is a user guide for the MS-DOS operating system. It


describes Microsoft Version 3.30 of MS-DOS, and is for anyone who
wishes to use this operating system on an Olivetti Personal Computer.

SUMMARY

This manual is in two parts: the first part teaches you about the basic
concepts of MS-DOS, the second part is a reference section to the
Video File Editor and to a selection of MS-DOS commands. The
appendix is a glossary which describes the technical terms used in this
manual.

PRE·REQUISITE PUBLICATIONS

Installation and Operations Guide for your Personal Computer.

RELATED PUBLICATIONS

MS-DOS Software Installation Guide


MS-DOS Quick Reference Guide
MS-DOS Messages
MS-DOS Reference Manual
MS GW-BASIC Interpreter under MS-DOS User Guide
MS GW-BASIC under MS-DOS Quick Reference Guide

DISTRIBUTION: General(G)

FIRST EDITION: February 1988

SECOND EDITION: January 1989


CONTENTS

PART I
1. LEARNING ABOUT MS·DOS

TERMS YOU SHOULD KNOW 1-1

INTRODUCING MS-DOS TERMS 1-1

THE KEYBOARD 1-7

KEYS YOU USE WITH MS-DOS 1-7

2. LEARNING ABOUT DISKS, FILES,


DIRECTORIES

FLOPPY DISKS 2-1

51/4 INCH FLOPPY DISKS 2-1

DISK PROTECTION 2-2

31/2 INCH FLOPPY DISKS 2-4

HARD DISKS 2-5

FORMATTING YOUR DISKS: THE FORMAT COMMAND 2-5

HOW TO NAME YOUR FILES 2-6

DIRECTORIES 2-7

3. GETTING STARTED

HOW TO START AND END YOUR MS-DOS SESSION 3-1

STARTING MS-DOS 3-1

v
QUITTING MS-DOS 3-3

HOW TO MAKE A BACKUP COPY OF YOUR MS-DOS


DISK 3-3

IF YOU HAVE A HARD DISK 3-5

IF YOU HAVE ONLY ONE FLOPPY DISK DRIVE 3-8

4. USING COMMANDS

USING FILE COMMANDS 4-1

THE DIR COMMAND 4-1

THE COPY COMMAND 4-4

THE DEL COMMAND 4-5

THE RENAME COMMAND 4-6

THE TYPE COMMAND 4-7

THE PRINT COMMAND 4-8

USING DISK COMMANDS 4-9

THE FORMAT COMMAND 4-9

THE DISKCOPY COMMAND 4-11

5. USING APPLICATIONS WITH MS-DOS

HOW TO RUN APPLICATION PROGRAMS 5-1

HOW TO CREATE A FILE WITH EDIT 5-3

PART II

6. THE VIDEO FILE EDITOR (EDIT)

vi
CONTENTS

INTRODUCTION 6-1

THE EDITING SESSION 6-1

HOW TO INVOKE THE VIDEO FILE EDITOR 6-1

EDIT 6-1

HOW TO EXIT EDIT AND/OR SAVE FILES 6-3

THE DISPLAY 6-4

THE KEYBOARD 6-6

USING THE EDITOR COMMAND LINE 6-9

STRING SEARCHES 6-9

COMMANDS 6-11

GOTO 6-11

DELETE 6-12

FILE 6-12

7. MS-DOS COMMANDS

TYPES OF MS-DOS COMMANDS 7-1

WHAT ARE INTERNAL COMMANDS? 7-1

WHAT ARE EXTERNAL COMMANDS? 7-3

USING PATHS WITH EXTERNAL COMMANDS 7-4

REDIRECTING COMMAND INPUT AND OUTPUT 7-5

FILTERS AND PIPES 7-6

COMMAND CATEGORIES 7-8

vII
NOTATION CONVENTIONS 7-9

COMMAND DESCRIPTIONS 7-12

APPEND 7-12

ASSIGN 7-14

ATTRIB 7-15

BACKUP 7-18

BREAK 7-21

CHDIR 7-22

CHKDSK 7-24

CLS 7-25

COMMAND 7-26

COMP 7-28

COPY 7-30

CTTY 7-34

DATE 7-35

DEL 7-37

DIR 7-38

DISKCOMP 7-40

DISKCOPY 7-43

ERASE 7-44

EXIT 7-44

viii
CONTENTS

FC 7-45

FIND 7-46

FORMAT 7-48

GWBASIC 7-52

JOIN 7-52

LABEL 7-53

MKDIR 7-55

MORE 7-56

PATH 7-57

PRINT 7-58

PROMPT 7-62

RENAME 7-63

REPLACE 7-64

RESTORE 7-68

RMDIR 7-70

SET 7-71

SORT 7-72

SUBST 7-73

TIME 7-75

TREE 7-76

TYPE 7-77

Ix
VER 7-78

VER IFY 7-79

VOL 7-80

XCOPY 7-81

A. GLOSSARY OF TERMS

x
1. LEARNING ABOUT MS·DOS
TERMS YOU SHOULD KNOW

INTRODUCING MS-DOS TERMS

When you are introduced to a new or different idea, you must often
learn a new set of words to understand the idea. The MS-DOS
operating system is no exception. The following pages explain some
terms you will need to know so that you can read and use this manual.

Program

Programs, often called application programs, applications, or software,


are series of instructions written in computer languages. These
instructions are stored in files and tell your computer to perform a task.
For example, a program might tell your computer to alphabetically sort
a list of names. Spreadsheets and word processors are other
examples of programs.

File

A file is a collection of related information, like the contents of a file


folder in a desk drawer. File folders , for instance, might contain
business letters, office memos, or monthly sales data. Files on your
disks could also contain letters, memos, or data. For example, your
MS-DOS master disk contains more than thirty files. Your other disks
may contain files that you've created, or that came with the disk.
~ -

......... \ / -
~- ,,~
\ / /'
[g!~·
LIO ·¥.1.
:~. '

0 0

0
Fig. 1-1 File Folders

Filename

Just as each folder in a file cabinet has a label, each file on a disk has
a name. This name has two parts: a filename and an extension. A
filename can be from one to eight characters in length, and can be
typed in uppercase or lowercase letters. MS-DOS automatically
converts filenames to uppercase letters. Filename extensions consist
of a period followed by one, two, or three characters. Extensions are
optional, but it's a good idea to use them, since they are useful for
describing the contents of a file to you and to MS-DOS. For instance, if
you want to be able to quickly identify your report files, you can add the
filename extension ".RPT" to each one. Here's an example of a
filename with this extension:

14 II&DOS USER GUIDE


LEARNING ABOUT ...·DO.

P7RESS.RP\
filen ame filename extension

When you look at the directory on your MS-DOS master disk, you will
see many files with the extension ".EXE" or ".COM". The extension
".EXE" means executable, and ".COM" means command. These
extensions tell MS-DOS that the files are programs that can be run.
Many files will have other kinds of extensions, such as ".DOC" and
".TXT", which might contain text. Another common program file
extension is ".BAS" for BASIC programs. Some application programs
assign filename extensions automatically. For example, Microsoft
Multiplan assigns the extension ".MP", and Lotus 1-2-3 assigns one of
three extensions, for instance ".WKS" for worksheet files.

Directory

A directory is a table of contents for a disk. It contains the names of


your files, their sizes, and the dates they were last modified.

Volume Label

When you use a new disk, you can put a label on the outside of it to
help you identify its contents. You can also give each of your disks an
internal name, called a volume label.

You can look at the volume label on a disk by displaying its directory.
Some programs may look at the volume label to see if you are using
the correct disk. So make sure that you label your disks. See Chapter
4, "Using Commands", for step-by-step instructions on how to create a
volume label for a disk.

Disk Drive

To use the files or programs that are on a floppy disk, you must first
insert the disk into a floppy disk drive. Floppy disk drives are
commonly referred to as the "A:" drive and the "B:" drive. A hard disk
drive, normally installed inside your computer, is usually referred to as
the "C:" drive. Check your "Installation and Operations Guide" to see

14
which drive is "A:" and which is "B:" (or "C:").

Floppy disk drive Hard disk drive

Fig. 1-2 Floppy and Hard Disk Drives

Drive Name

A complete drive name consists of a drive letter and a colon. When


using a command, you may need to type a drive name before your
filename to tell MS-DOS where to find the disk that contains your file.
For example, suppose you have a file named FINANCES .DOC on the
disk in drive "B:". To tell MS-DOS where to find this file you would type
the drive name before the filename:

B:FI NAN CES .DOC

driv~me filen~with extension

1-4 II8oD08 USER GUIDE


LEARNING ABOUT ...·DO.

The Default Drive and the MS-DOS Prompt

If you don't specify a drive name when you type a filename, MS-DOS
automatically searches for the file on the disk in the default drive. The
default drive is where MS-DOS searches first when you type a
command. To let you know that it is ready to receive a command, MS-
DOS displays a symbol, called a prompt, that contains the default drive
letter followed by a greater-than sign (». Following the greater-than
sign is the cursor, the blinking box or flashing underline that shows
where the next character you type will appear. Here's an example of a
typical MS-DOS prompt and the cursor:

/A>\
MS - DOS prompt cursor

So when your prompt is A>, MS-DOS searches only the disk in drive
"A:" (the default drive) for files and programs unless you tell it to search
in another drive.

Changing the Default Drive

To change the default drive, you simply type the letter of the desired
drive, followed by a colon. For example, if you will be working primarily
with files on drive "B:", it is easier to change the default drive to "B:", so
that you won't have to type the letter "B", followed by a colon, with
every command and filename. Here's how to change the default drive:

B:

Command

Just as you will run programs to create and update files containing your
data, you will also need to run some special programs, called MS-DOS
commands, that let you work with entire files. When you type MS-DOS
commands, you are asking the computer to perform tasks. For
example, when you use the DISKCOPY command to copy your MS-
DOS master disk, you are using a file named DISKCOPY.EXE, whose

,-1
task is to copy the files on the MS-DOS disk.

Other MS-DOS Commands:

• Compare, copy, display, delete, and rename files

• Copy, format, and label disks

• Run your programs, as well as those supplied with MS-DOS

• List directories for disks

• Set the date and time

• Set printer and screen options

You'll learn more about MS-DOS commands in Chapter 4, "Using


Commands". But for more detailed descriptions of commands, see
Chapter 7 "MS-DOS Commands".

Devices

Whenever you use your computer, you supply the information (input)
and expect a result (output) . Your computer uses pieces of hardware
called devices to receive input and send output.

For example, when you type a command, your computer receives input
from your keyboard and disk drive, and usually sends output to your
screen . It can also receive input from a mouse, or send output to a
printer. Some devices, such as disk drives, perform both input and
output.

Device Names

Device names are special names given to each device that your
computer knows about. An example of a device name is "LPT1 :",
which stands for the first parallel lineprinter connected to your
computer. When you add a new device, such as a mouse, to your
computer, you sometimes need to tell MS-DOS about it by setting up
(configuring) your computer for that device. Refer to the information
that came with your device, or to the "MS-DOS Software Installation

MS-DOS USER GUIDE


L.ARNING ABOUT .... DO.

Guide", for more information on configuring your computer for devices.

Error Messages

If you or your computer makes a mistake when using a device or MS-


DOS command, MS-DOS displays an appropriate error message.
Error messages apply to general errors (such as misspelling a
command) or to device errors (such as trying to use a printer that is out
of paper) . For a complete list and explanation of each MS-DOS error
message (device and general), see the "MS-DOS Messages" manual.

Memory

Memory is the place in your computer where information is actively


used . When you run a program, MS-DOS stores that program and the
files it uses in the computer's available memory. Some programs and
files use more memory than others, depending on how large and
complex they are.

THE KEYBOARD

KEYS YOU USE WITH MS-DOS

Now that you've learned about MS-DOS terms, you can learn about the
keys you will be using with the MS-DOS operating system.

Differences between keys

In addition to the keys you'd find on a typewriter, your computer


keyboard has some keys that have special meanings to MS-DOS.

First, note that there are two important differences between a typewriter
keyboard and a computer keyboard:

A computer understands the difference between a one and a lowercase


L. Be sure you don't type a lowercase L when you mean a one.
Capital 0 and zero may look alike, but they have different meanings to
a computer. Many computers display a zero with a diagonal line (0)
through it. Make sure you type the correct letter or number when you
give commands to MS-DOS.

The ENTER key

Press the ENTER key after you type commands.


When you press the ENTER key after typing a
command, MS-DOS performs the command.

Moving the Cursor: Keys That Move the Cursor

The SPACEBAR moves the cursor to the right.

Use the BACKSPACE key to correct typing mistakes


on the current line. The BACKSPACE key deletes
characters as it moves the cursor to the left.

To move the cursor to the left or right without deleting


any characters, you must use the direction keys.
Direction keys move the cursor right, left, up, and
down. They do not affect the characters that are
displayed. Some programs ignore these keys or do
not use them. In these manuals, the direction keys
are also referred to as the RIGHT, LEFT, UP and DOWN
arrow keys.

Control Key Combinations: Using the CONTROL Key

The CONTROL key has a special task. It lets you give


complex commands to your computer by pressing
~ only two or three keys. You must hold down the
~ CTRL key while you press another key. That is, you
use the CONTROL key as you would the SHI FT key.

1.. II&D08 USER GUIDE


LEARNING ABOUT ...·DO.

When you press the GTRL key and the S key at the
~~ same time, you can stop the scrolling of the screen
~D display. Then to continue scrolling, press GTRL S
again.

~~ When you press the GTRL key and the G key at the
same time, you can stop a command.
~D

~M~ If you want to restart MS-DOS, press the GTRL, AL T


~DD and DEL keys at the same time.

If you have an 101 or 102 Key New Industry


~PAUSE~ Standard Keyboard, when you press the PAUSE key,
I \ you can stop the scrolling of the screen display. Then
to continue scrolling, press the SPAGE bar.
2. LEARNING ABOUT DISKS, FILES,DIRECTORIES
LEARNING ABOUT DISKS, FILES, DIRECTORIES

FLOPPY DISKS

A floppy disk is a flexible, magnetized plastic disk. A double-density


floppy disk can store up to 400 single-spaced pages of text. A high-
density disk can store about three times that amount.

5 1/4 INCH FLOPPY DISKS

Every floppy disk is enclosed in its own protective cover. The front of
this cover is smooth, wh ile the back has visible seams. You should
always place labels on the front of the cover, at the top, so that the
label doesn't touch the magnetic surface of the disk. It's also a good
idea to use a felt-tip pen when writing on labels - a pencil or ballpoint
pen can damage the disk if you press too hard.
..
1 .ll~ ,{EII~~
k~R~:~ .. _ .- § , ~ o

0 o of
0


0
0

0
0

00
Front


V 0 '"
Back

0

Fig. 2-1 A 5 1/4 inch Floppy Disk

You should store floppy disks in a safe place, away from dust,
moisture, magnetism, and extreme temperatures. Be sure to label each
disk you use, since labels help you identify what files are on the disk
and remind you that the disk has information stored on it.

DISK PROTECTION

Protecting Your Disks

Labels help you keep track of the information on your disks, but you
may also need to protect the disks themselves. Some floppy disks are
protected, letting you examine information on them without letting you
change anything. These are called write-protected disks.

MS-DOS USER GUIDE


LEARNING ABOUT DISKS, FILES, DIRECTORI.S

Do hold at corner Do store in jacket Do write with felt tip pen

Don't write with pencil or


Don 't touch disk Don 't expose to extreme heat
ballpoint pen

Fig. 2-2 5 1/4 inch Diskette Advice

Floppy disks can be write-protected in one of two ways. Some have a


small piece of tape, called a tab, covering a notch on the right side of
the disk. You can copy information onto a write-protected disk by first
removing the write-protect tab; however, you should consider why the
disk was protected - before you change its contents. After you have

24
copied or changed a write-protected disk it's always a good idea to
replace the write-protect tab.

If a disk does not have a write-protect notch, it is permanently write-


protected. Many application programs, come on write-protected disks
that protect the files from being destroyed accidentally.

3 1/2 INCH FLOPPY DISKS

About 3 1/2 inch disks

The MS-DOS Ver 3.30 operating system also supports 3 1/2 inch disks,
which, like 5 1/4 inch floppy disks, are portable magnetic disks. Data
on 3 1/2 inch disks is more densely packed, so depending on the style,
a single 3 1/2 inch disk can store as much (or more) data than a high-
density floppy disk.

shield

r =
)
0
0 0
(
{}
-'

D~'
(3
r 0 o l~r\ 0
0 0
Front
write- p rotect tab
Back
Fig. 2-3 A 3 1/2 inch Floppy Disk

These smaller disks, sometimes called microfloppies, have rigid plastic


covers with metal shields that guard the disk from dirt and fingerprints.
When you place the disk into the disk drive, the computer automatically
moves this shield aside to read the disk.

Ms-DOS USER GUIDE


LEARNING ABOUT DISKS, FILES, DIRECTORIES

Note that 3 1/2 inch disks have a write-protect notch. This notch can
be covered with a built-in tab. As with 5 1/4 inch floppy disks, if the
write-protection notch is covered by the tab, no data can be written to
the disk. Be sure to label your 3 1/2 inch disks and store them in a safe
place. As with 5 1/4 inch floppy disks, extreme temperatures,
magnetism , dust, and fingerprints can all harm your data on a disk.

Note MS-DOS works virtually the same way with both 3 1/2 inch and 5
1/4 inch floppy disks. So in this documentation, the term floppy disk is
used to mean either of these two types of disks.

HARD DISKS

In addition to floppy disks, some computers use a hard disk, which can
store much more information than a floppy disk. Computers also take
less time to find information stored on a hard disk than on a floppy disk.
A hard disk is usually built into the computer.

When you store application programs, including MS-DOS, on your hard


disk, you should keep a backup copy of the programs on a floppy disk
in case the information on the hard disk is accidentally damaged or
destroyed. (For more information about making a backup copy of your
MS-DOS disk see Chapter 3, "Getting Started".)

FORMATTING YOUR DISKS: THE FORMAT COMMAND

Before you can use your new disks for storing information, you must
format them. You do this with the FORMAT command, a special
program that structures a disk so that MS-DOS can find information on
it. The FORMAT command also checks the disk for defective spots.

You can format both floppy and hard disks. But remember that if a disk
is not blank, formatting it destroys any data already on the disk. You
will learn more about the FORMAT command in Chapter 4, "Using
Commands".
HOW TO NAME YOUR FILES

When naming a file, you may have trouble finding a name that uniquely
identifies the file's contents. Dates, for example, are often used in
filenames; however, they take up several characters, leaving you with
little flexibility. Other common names for files are words like BUDGET,
FINANCES, ANALYSIS, REPORT, etc. These kinds of filenames
identify the contents, but leave little room for dates. So the secret is to
find a compromise-a point where you can combine a date with a word,
creating a unique filename. The name of a typical MS-DOS file (see
Chapter 1) looks like this:

custo mer . 1st

fil ena~ file~ e x tens i on

Notice that the filename was typed in lowercase letters. You can type
filenames in uppercase or lowercase letters, even though MS-DOS
converts them into upper-case letters. Some more examples of
filenames are:

BUDGE . 86
TAKEOVER . BID
JUNE86
FINANCES . DOC
SCHEDULE .MAY

Valid Filename Characters

Many of your filenames will contain only letters and numbers. But you
may also use any of the following symbols (and letters) in your
filenames and extensions:

A-Z a-z 0-9 $ % ' - @ I }- ,! # ()&•_

Warning: Some applications may not let you use all of these symbols.
If in doubt use only letters and numbers.

MS-DOS USER GUIDE


LEARNING ABOUT DISKS, FILES, DIRECTORIES

Invalid Filenames

Avoiding invalid filenames Although you do have some freedom


when naming your files, there are certain names that you may not use,
because MS-DOS reserves them for specific devices that your
computer uses. These invalid names are AUX, CLOCK$, COM, CON,
LPT, LST, NUL, and PRN . You may use these names as extensions
(except for CLOCK$), but remember not to use them to name your
files.

DIRECTORIES

The names of your files are kept in a directory on each disk. The
directory also contains information on the sizes of the files, and the
dates they were created and updated.

The MS-DOS Directory

If you want to know what files are on your disk, you can use the DIR
command. This command tells MS-DOS to display all the files in a
specific directory on a disk. For example, if your MS-DOS disk is in
drive "A:" and you use the DIR command, the directory display would
look similar to this:

2-7
Volume in driv e A is ST ART ( 3 30)
Directory of A: \

COMMAND COM 25292 11 - 30 - 87 9:00a


ANSI SYS 1647 11 - 3 0 - 87 9:00a
COUNTRY SYS 11254 11 - 3 0 - 87 9 :00 a
DISPLAY SYS 11259 11-30 - 87 9:00a
DRI VER SYS 1165 11 - 30 - 87 9:00a
FASTOPEN EXE 3888 11 - 30 - 87 9:00a
FDISK COM 48919 11 - 30 - 87 9:01a
FORMA T CO M 11681 11 - 30 - 87 9:00a
KEYB COM 9617 11 - 30 - 87 9:00a
KEYBOARD SYS 22119 11 - 30 - 87 9:00a
MODE CO M 15440 11 - 30 - 87 9 : 00a
NLSFUNC EXE 3029 11 - 3 0 - 87 9:00a
PRINTER SYS 13559 11 - 30 - 87 9 :00 a
REPLACE EXE 13234 11 - 3 0 - 87 9:00a
SELECT CO M 4132 11 - 30 - 87 9:00a
SYS COM 4735 11-30 - 87 9:00a
VD ISK SYS 3424 11 - 3 0 - 87 9:00a
XCOPY EXE 11216 11 - 3 0 - 87 9 :0 0a
EGA CPI 49065 11 - 3 0 - 87 9 :0 2a
LCD CPI 10752 11 - 3 0 - 87 9:00a
4201 CPI 17089 11 - 3 0 - 87 9:00a
5202 CPI 459 11 - 3 0 - 87 9:00a
22 File(s) 5120 byt es free

You can also get information about any file on your disk by entering the
DIR command followed by a filename. For example, to display
directory information for a file named schedule, you could use the
following command :

DIR SCHEDULE

MS-DOS would respond by displaying the filename SCHEDULE


followed by the file's size in bytes and the date and time it was last
changed; for example: .
SCHEDULE 3698 8 - 7 - 87 4:11p

2-8 Ms-DOS USER GUIDE


3. GETTING STARTED
GETTING STARTED

HOW TO START AND END YOUR MS· DOS SESSION

The first two chapters in this manual introduced you to the


fundamentals of MS-DOS. Now it's time to put your new knowledge to
the test. You'll start by loading MS-DOS into your computer's memory.

STARTING MS-DOS

To start MS-DOS, just follow these steps (these steps work for
computers that have either hard disks or floppy disks):

1. First, make sure your computer is turned off.

2. Insert this disk into drive "A: ". (Refer to your computer's
"Installation and Operations Gu ide" to identify the correct drive.)

3. Close the disk drive door.

4. Turn on the power for your monitor and your computer.

The light on the disk drive should glow, and you should hear some
whirring noises as your computer reads the disk. You should then see
something similar to the following on your screen :
Cur r e nt date is Tu e 1 - 01 - 1980
En te r n e w d ate (mm - dd ' YY) :

MS-DOS asks you to provide the date.

3-1
Setting the Date and Time

1. Type the date. For example, if the date is July 6, 1988, you simply
type the following command, then press the ENTER key:

07-06-88

If the date is already correct, or you do not want to answer this


prompt, press the ENTER key to move to the next step.

2. Type the time according to a 24-hour clock. For example, if it is


1:30 P.M ., type the following , then press the ENTER key:

13:30

If the time is already correct, or you do not want to answer this prompt,
press the ENTER key.

MS-DOS does not accept your command until you press the ENTER
key.

Note

If you make a mistake when you are typing the date or time, simply
backspace over the mistake and retype (as you use the BACKSPACE
key, you will notice that the characters disappear) . If you make a
mistake and have already pressed the ENTER key, press the CONTROL
ALT DEL keys simultaneously to restart MS-DOS and try again.

Your screen should look something like this (your time and date may be
different, depending on what you typed in steps 1 and 2) :
Current date is Tue 1 - 01 - 1980
Enter new date (mm - dd - yy): 07 - 06 - 8 7
Curre nt tim e is 0:00:45:10
EnL e r ne w time : 13 : 3 0

Microsoft (R) MS - DOS ( R ) Version 3 . 3 0


( c ) Copyright Microsoft Corp 1981 - 1987

1\. )

In this example, the default drive is drive "A:", so the A> is the standard

Ms-DOS USER GUIDE


GETTING STARTED

MS-DOS prompt. When you see A> prompt, MS-DOS is waiting for
instructions from you.

Before you start giving these instructions, however, you might like to
know how to quit MS-DOS.

QUITTING MS-DOS

There is no "quit" command in MS-DOS, but you can end your MS-
DOS session easily by following these steps:

1. Make sure that your last command is finished. You should see the
MS-DOS prompt (for example, A» on the screen.

2. Remove the floppy disks from the drives, put them back in their
protective jackets, and store them in a safe place, away from dust,
moisture, and magnetism .

3. Turn off your computer.

HOW TO MAKE A BACKUP COPY OF YOUR MS-DOS


DISK

In this section you'll learn how to make a backup copy of your MS-DOS
disk if you have two floppy disk drives. If you have a hard disk, read "If
You Have a Hard Disk". If you have only one floppy disk drive, read
this section, then "If You Have Only One Floppy Disk Drive" at the end
of this chapter.

MS-DOS comes with a program named DISKCOPY that lets you copy
the contents of disks. You need not format your blank disks before you
use the DISKCOPY command.

Making a Backup Copy of MS-DOS

Making a backup copy of your MS-DOS master disk is easy:

1. Start MS-DOS with the MS-DOS master disk in drive A:.


2. Make sure that a blank disk is in drive B:.

3. At the MS-DOS prompt, type the following:

DISKCOPY A: B:

4. Press the ENTER key. If you make a mistake when typing this
command, such as misspelling it, MS-DOS displays the following
error message:

Ba d co mm an d or file na me

A)

To fix this error, retype the command, and check the spelling
before you press the ENTER key. Your screen should look like this:

A) DIS KCOPY A: B:

Insert SOURCE d is k ette in dri v e A :

Insert TARGET diskette in dri v e B:

Press any k ey whe n ready . . .

Note: If you have only one floppy disk drive, MS-DOS prompts you
to insert the drive A disk. For more information, see the section, "If
You Have Only One Floppy Disk Drive", later in this chapter.

5. Press the SPACEBAR to start the DISKCOPY program. The disk


copying process takes time, so you'll have to wait awhile. When
the DISKCOPY program is complete, MS-DOS asks:

Copy another? (yi N)

6. Type N (for No) to end the DISKCOPY program .

You now have two MS-DOS disks: the MS-DOS master disk and the
copy you just made.

Label the new disk, and cover its write-protect notch with a write-
protect tab. Then put your MS-DOS master disk in a safe place, away
from dust, moisture, and magnetism. If anything should happen to the

MS-DOS USER GUIDE


GETTING STARTED

copy you have just made, you 'll have to use the master disk to make
another copy.

Note: Always use your backup copy of the MS-DOS master disk. Keep
the master disk in a safe place.

IF YOU HAVE A HARD DISK

If your computer has a hard disk, you should copy all the files from the
MS-DOS master disk onto the hard disk. Then each time you start
MS-DOS , you won 't need to use a floppy disk; instead , you'll be able to
start MS-DOS directly from the hard disk. When you have copied the
MS-DOS files onto your hard disk, the original floppy disk will be your
backup copy.

But before you can copy the MS-DOS files onto your hard disk, you
may need to install MS-DOS on it first. To find out whether you need to
do this, see the chapter "Hard Disk Systems" in the "MS-DOS Software
Installation Guide".

Warning: Whenever you format a disk, you destroy its files. It's a good
idea to copy any files from your hard disk onto floppy disks before you
format the hard disk (to learn how to copy files , see Chapter 4, "Using
Commands"). Once you have formatted your hard disk you should
never have to format it again.

Formatting Your Hard Disk

The following example assumes that your hard disk is named drive
"C:". Follow these steps to format it:

1. Start MS-DOS, with the MS-DOS system disk in drive "A:" .

2. At the MS-DOS prompt, type the following command:

FORMAT C: IV /S
then press the ENTER key

3. If you've typed the command correctly, MS-DOS formats the disk


in drive C. However, if you make a mistake when typing the
command line, such as misspelling it, MS-DOS displays the
following message:

Bad co mmand or file na me

A)

To fix this error, retype the command, and check the spelling
before you press the ENTER key. If you have typed the command
correctly, MS-DOS displays a message showing you its progress
as it formats your hard disk.

When the format process is complete, MS-DOS displays the


following prompt:

Volu me la b e l ( 11 characters , ENTER for none ) ?

4. Type the name that you want to use to identify the hard disk (for
example, HARD DISK), and press the ENTER key. MS-DOS asks:

Format a n other? (y i N )

5. Type N (for No) to end the FORMAT program .

To copy files onto your newly formatted hard disk, you must use the
COPY command. This command is automatically loaded into your
computer's memory when you start MS-DOS.

Note: You cannot copy files onto your hard disk by using the
DISKCOPY command. The DISKCOPY command works only for
copying one floppy disk to another.

Copying Files onto a Hard Disk

To copy your MS-DOS master disk onto a hard disk (drive C) , follow
these steps:

1. Make sure that the MS-DOS master disk is in drive "A:".

2. At the MS-DOS prompt, type the following command:

COPY A:*.* C:

II&D08 USER GUIDE


a.TTIMa STARTED

This command tells MS-DOS to copy all fi les on drive "A:" to drive
lie:".

3. Press the ENTER key.

The COPY program then lists each file on the screen as it is copied
onto the new disk. When the process is complete, MS-DOS shows you
how many files it has copied.

You now have two MS-DOS disks: the MS-DOS master disk and the
copy you have just made on your hard disk.

Fig. 3-1 Master Diskette Copied to Hard Disk

Now, put the master disk in a safe place, away from dust, moisture,
and magnetism. If anything happens to your hard disk, you will have to
use the master disk to make another MS-DOS backup copy.

3-7
IF YOU HAVE ONLY ONE FLOPPY DISK DRIVE

If your computer has only one floppy disk drive, you can still use MS-
DOS commands as you would on a system with more than one drive,
but you must also specify a drive name when you type a command. By
specifying the drive letter, you tell your computer to perform the
command on that drive. The drive names "A:" and "B:" then represent
the disks that you put into the single drive. In response to your
commands, MS-DOS then prompts you to insert the proper disk, as in
the following example:
A> FORMAT A: Iv
Insert new diskette for drive A:
and strike ENTER wh en ready

If you specify drive "B:" in a command when you have only one drive,
MS-DOS prompts you to insert the disk for drive "B:". To make a copy
of your MS-DOS disk if you have only one floppy disk drive, type the
following at the MS ~DOS prompt

DISKCOPY A: B:

MS-DOS responds with the following message:

Insert SOURCE diskette in drive A:


Press any key when ready . . .

Remove the MS-DOS disk, put the blank disk into the drive, and press
any key. You may need to reinsert the disks for drives "A:" and "B:"
several times to complete the copy process.

Note: The letter in the system prompt represents the default drive; it
does not represent the last disk used.

Ms-DOS USER GUIDE


4. USING COMMANDS
USING COMMANDS

USING FILE COMMANDS

You can use several MS-DOS commands to manage your files . Some
of the more common commands are DIR, COPY, DEL, RENAME , and
PRINT.

Note: The examples in this chapter assume that drive "A:" is the
default drive. Also, many of these examples use filenames which are
intended for illustrative purposes only - to use these commands, you
would substitute the name of a file on the default disk.

THE DIR COMMAND

If you want to find out what files are on a disk, you can list its directory
by using the MS-DOS DIR command. For example, to display the
directory of the disk in drive 8, you would use the following command :

DI R B :

s how m~ ~.Of t h e d i sk
d irector y ... i n d ri v e B

You could also display the directory on the hard disk by using the drive
letter "C:" instead of "8:" with the DIR command. If you use the DIR
command without a drive letter, MS-DOS lists the directory of the disk
in the default drive.

4-1
Example

Listing the MS-DOS Directory

Suppose you want to see how many files are in the directory of the
MS-DOS disk in drive "A:". To display this directory you would simply
follow these steps:

1. Make sure the MS-DOS disk is in drive "A:" .

2. Make sure the disk drive door (for drive A:) is closed

3. At the MS-DOS prompt, type the following command, then press


the ENTER key:

DIR

4. If the disk drive door (for drive "A:") is open when you try to use
this command, MS-DOS will display the following error message:
Not ready error reading drive A

Abort , Retry , Ignore?

To fix this error, you simply close the door for drive "A:" and type R
(for Retry)

5. MS-DOS then displays the directory. If necessary, you can stop


the directory listing from scrolling by pressing CTRL S. To view the
rest of the display, you simply press CTRL S again .

4-2 MS-DOS USER GUIDE


USING COMMANDS

Your screen should look similar to this:

Volume in dri v e A is DOS 3 - 3

Directory of A:\

COMMAND COM 25292 11 - 30 - 87 9:00a


ANSI SYS 1647 11 - 30 - 87 9:00a
COUNTRY SYS 11254 11 - 30 - 87 9:00a
DISPLAY SYS 11259 11 - 3 0 - 87 9:00a
DRIVER SYS 1165 11 - 30 - 87 9:00a
FASTOPEN EXE 3888 11 - 3 0 - 87 9:00a
FDISK COM 48919 11 - 30 - 87 9:01a
FORMAT COM 11681 11 - 30 - 87 9:00a
KEYB COM 9617 11 - 30 - 87 9:00a
KEYBOARD SYS 22119 11 - 30 - 87 9:00a
MODE COM 15440 11 - 30 - 87 9:00a
NLSFUNC EXE 3 029 11 - 30 - 87 9 :0 0a
PRINTER SYS 13559 11 - 30 - 87 9 : 00a
REPLACE EXE 13234 . 11 - 30 - 87 9:00a
SELECT CO M 4132 11 - 30 - 87 9:00a
SYS COM 4735 11 - 30 - 87 9:00a
VDISK SYS 3424 11 - 3 0 - 87 9:00a
XCOPY EXE 11216 11 - 30 - 87 9:00a
EGA CPI 49065 11 - 30 - 87 . 9:02a
LCD CPI 10752 11 - 30 - 87 9: 00 a
4 2 01 CPI 17089 11 - 30 - 87 9:00a
5202 CPI 459 11 - 30 - 87 9:00a
22 File(s) 5120 bytes free
THE COPY COMMAND

If you need to copy files, you can use the COpy command to copy one
or more files, either on the same disk or from one disk to another. For
instance, suppose you need a copy of a file named SALES.DOC that
you have on a disk in drive A, and suppose you want to call this new
copy MONTHLY.RPT.

Example

Copying a file.

To copy the SALES.DOC file and call the new copy MONTHLY.RPT
you would just follow these steps:

1. Make sure that the disk with the SALES.DOC file is in drive "A:"
and that "A:" is the default drive.

2. At the MS-DOS prompt, type the following command:

COPY SALES. DOC MONTHL Y.RPT

3. Press the ENTER key.

You cannot give the new copy of a file the same name as the original.
You can, however, copy a file from one disk to another and keep the
same filename. For example, to copy a file from the disk in drive "A:"
to the disk in drive "8:", use the following command:

/0"7"'" DOC \m,"D~


Mak e a cop y ... n a me d . . . a n d pu t it on Na me t h e co py
of a file . . . " S ALES .D OC " t h e d is k i n dr ive B of t h e file
o n d ri v e A " SALES .DOC "

IIS-D08 USER GUIDE


USING COIIMANDS

Note: In the previous example, if "A:" is the default drive (that is, if the
prompt is "A>"), you needn't type the letter "A:", followed by a colon,
before the first filename. If you don't specify a new name, the copy will
also have the name of the original file. For example, the following
commands all produce the same result:

COPY A :SALES . DOC B:SALES.DOC

COPY SALES . DOC B:SALES.DOC

COPY SALES.DOC B:

Again , by substituting the drive letter "C" for "8", you could copy the
SALES.DOC file to drive "C:".

THE DEL COMMAND

Just as you may need to make copies of files, you may also need to
remove old or unnecessary files to clean up your file system. When you
want to erase a file from a disk, you can use the MS-DOS DEL
command. Remember, though, that the DEL command permanently
erases the file. To delete an old sales. doc file from the disk in drive
"8:", at the MS-DOS prompt you would use the following command:

DEL B:SALES . DOC

Delete. { .ile ~med


. . " SALES . DOC "
fro m the dis k in drive B

You could also delete a file named SALES.DOC from drive "C:" by
simply substituting the drive letter "C" for "8".

Example

Deleting a file.

Suppose you have an old copy of the SALES.DOC file that you no
longer need. To delete this file from the disk in the default drive, you
would just follow these steps:
1. Make sure that the disk with the SALES.

2. At the MS-DOS prompt, type the following command:

DEL SALES. DOC

3. Press the ENTER key. MS-DOS then deletes the SALES. DOC file
from the disk.

Note: The DEL command does not work if you type the word delete.
You can, however, substitute the word ERASE in place of the DEL
command.

THE RENAME COMMAND

Occasionally, you may want to change the name of a file. For example,
suppose you have a file named MONTHLY.RPT on a disk. When you
add other monthly reports to your disk, you may want to change the
name of the original file to something more specific. To change the
name to ANNUAL.RPT, for instance, you would use the following
command:

RENAME MONTHLY.RPT ANNUAL.RPT

/
Change the name
\
. . . from
~. . . to
of a file . . . "MONTHLY.rpt " " ANNUAL.RPT "

You can only rename files on the same disk, so you cannot change
A:MONTHLY.RPT to B:MONTHLY.RPT or C:MONTHLY.RPT.

Example

Renaming a file.

Suppose you want to rename a file named PAYROLL.DOC, on the disk


in the default drive, to SALARY. DOC. You would simply follow these
steps:

1. Make sure that the disk with the PAYROLL.DOC file is on the disk
in the default drive (nA:n).

Ms-DOS USER GUIDE


USING COMMANDS

2. At the MS-DOS prompt, type the following command:

RENAME PAYROLL.DOC SALARY.DOC

3. Press the ENTER key.

Note: The RENAME command can be abbreviated to REN.

THE TYPE COMMAND

If you want MS-DOS to display a file that contains text (often called a
text file) on the screen, use the TYPE command. For example, say
you have created a file named PHONE.LST on the disk in drive "A:" ,
and you want to check one of the phone numbers. To display the file
on the screen, you would use the following command:

/PE A : PHONE.LST

Display on the
screen . ..
... the ~named " PHO NE.LST "
that is on the disk in drive a.

Example

Displaying a file.

Suppose you want to check your employees' salary figures. So you


decide to look at a file named SALARY.DOC that is on the disk in the
default drive. To display the SALARY.DOC file you would just follow
these steps:

1. Make sure that the disk with the salary.doc file is in the default
drive (A) .

2. At the MS· DOS prompt, type the following command:

TYPE SALARY.DOC

3. Press the ENTER key.

MS·DOS then displays the SALARY. DOC file on the screen. If the
SALARY. DOC file is on drive "B:" or "C:", you could easily type the
drive letter, followed by a colon, with the TYPE command.

Hints: If the file is too long to fit on the screen, remember that you can
press CTRL S to prevent it from scrolling off the screen. When you
press CTRL S again, the file will resume scrolling. MS-DOS displays
only text files on the screen. So if you try to display a program file (one
with an extension of .COM or .EXE), you will see only strange symbols
on the screen. If you have an application program that creates files,
you may need to run the application to view them. For example, if you
use Microsoft Multiplan to create a file, Multiplan automatically adds
the extension .MP to the filename. You would then have to start
Multiplan to view the file.

THE PRINT COMMAND

If you have a printer attached to your computer, you can print files with
the MS-DOS PRINT command. Assume, for example, that you have a
file named invest.mnt and want to print it on your printer. You could
use the following command:

PRI N T I NV EST . MN T

Print a~e . . ~med " I N VEST. MN T "

Example

Printing a file.

Say you have a file that contains a list of investors and their phone
numbers, and suppose you want to print this file and keep it near your
phone. The file is named INVEST.MNT and is on the disk in drive "B:".
Drive "A: " is the default drive (A> is the prompt) . To print the
INVEST.MNT file , you would just follow these steps:

1. Make sure that the MS-DOS disk is in drive "A:" .

2. Make sure that the disk with the INVEST.MNT fi le is in drive "B :".

3. Check to see that your printer is on, has paper, and is ready to
print.

II8-D08 USER GUIDE


USING COMMANDS

4. At the MS-DOS prompt, type the following command:

PRINT B:INVEST.MNT

5. MS-DOS prompts you for the name of the printing device


connected to your computer (this name is usually the
communications port that the printer cable connects to) . Just type
the name, or press the ENTER key to print to the default printer.

Hints While a file is being printed, you can type other commands to
MS-DOS. You can even run other programs or create and modify files .
But since printing a file takes a lot of your computer's resources , your
tasks may take longer if you try to do them while you are printing a file.
So if you have a long file to print, you might schedule the printing for
when you plan to be away from your computer. In addition, if you want
to print a file that you've created with an application program, you may
also have to use the application program's print command to print the
file .

USING DISK COMMANDS

This section presents two commands that you use for disks: FORMAT
and DISKCOPY.

THE FORMAT COMMAND

When you purchase new disks, they are blank and unformatted. You
must format them before MS-DOS can use them . Formatting
structures a disk so that MS-DOS can find and store information on it;
formatting also checks the disk for defective spots. You can format a
disk by using the FORMAT command. To format a blank disk in drive
"B:", you would use the following command:

FORMA'r B : Iv

Format a . -----
d1sk .. . on .f
dr1v e ~
B . ... . .. and ask for a label

Note: If you have only one disk drive, MS-DOS prompts you to insert
the disk that you want to format. See If You Have Only One Floppy
Disk Drive, in Chapter 3, "Getting Started".
You can also format a blank disk in such a way that some special MS-
DOS files are copied onto it during formatting. These files are
necessary only if you want to use the disk to start MS-DOS. To format
a blank disk in drive B and include these special MS-DOS files, you
would use the following command :

_______ ~B: 7 /S ~
Format . . . on drive B . . . ask for a label . .. and copy the
a disk . .. special MS - DOS fil e s

If you don't want to use the disk to start MS-DOS, you don't need to
specify the /S option when formatting the disk. If you have a disk and
don't know whether you can use it to start MS-DOS, put the disk into
drive "A:" and press the CTRL ALT DEL key combination. If the disk does
not contain the system files, MS-DOS displays an error message.

Example

Formatting a Floppy Disk.

Suppose you need to create a new data disk to hold some tax records,
but you don't want to copy the special MS-DOS files when formatting
the disk. To format and label a blank disk (in drive "B:") without
including the special MS-DOS files, you simply follow these steps:

1. Make sure that the MS-DOS disk is in drive "A: ".

2. At the MS-DOS prompt, type the following command:

FORMAT B: IV
3. Press the ENTER key.

Your screen should look like this:

A)FORMAT B : Iv
Insert new diskette for drive B:
and strike ENTER when ready

4. Insert a blank disk in drive B.

4-10 lIMOS USER GUIDE


USING COMMANDS

5. Press the ENTER key to start the format process. When formatting
is complete, MS-DOS displays the following prompt:

Volume label ( 11 characters , ENT ER for none)?

6. Type a label that identifies the contents of this disk (for example,
DATA DISK), and press the ENTER key. MS-DOS then asks:

Forma t another? (yiN)

7. Type N (for No) to exit the FORMAT program .

In this example, you learned how to format a floppy disk that was in
drive "B:", a floppy disk drive. To format your hard disk, you should
follow the instructions in Chapter 3, "Getting Started". Now your disk is
formatted and ready to use. Be sure to label it on the outside cover,
and remember to include the volume label that you used in step 6. The
label will remind you that you have formatted the disk, and will help you
identify its contents.

Warning: The FORMAT program destroys any information already on


a disk. It's a good idea to check the directory of a disk before you
format it, just to make sure you won't be destroying any important files .

THE DISKCOPY COMMAND

You may often need to make copies of entire disks instead of individual
files. You can do this easily with the MS-DOS DISKCOPY command.
To use the DISKCOPY command, you must have:

• an MS-DOS disk

• a disk you want to copy

• a blank disk to put the copy on

4-11
To copy the contents of a disk in drive "A:" to a disk in drive "B:", you
would use the following command:

/'CO>'l "~
Copy a disk . . . from drive A . .. . .. to drive 13.

Note: You cannot use the DISKCOPY command to copy the contents
of a floppy disk to or from a hard disk. Instead, you must use the
COPY command .

Example

Copying a Floppy Disk.

Suppose you want to bring a data disk with you on a business trip, but
you don't want to take your original disk because it might get damaged.
All you have to do is use the DISKCOPY command to make a copy of
the disk. For example, to copy the contents of a disk in drive "A:" to a
disk in drive "B:", you simply follow these steps:

1. Put your MS-DOS disk in drive "A:".

2. At the MS-DOS prompt, type the following command :

DISKCOPY A: B:

3. Press the ENTER key. Your screen should look like this:

A>DISKCOPY A: B:

Insert SOURCE diskette in drive A :

Insert TARGET diskette in drive B:

Press any key when ready . .

4. Remove the MS-DOS disk from drive A, replacing it with the disk
you want to copy (SOURCE). Then place a blank disk (TARGET)
in drive "B:".

4-12 MS-DOS USER GUIDE


U.ING CO ....AND.

5. Press the SPACEBAR to start the DISKCOPY process. When the


disk has been copied, MS-DOS asks:

Copy another? (yiN)

6. Type N (for No) to exit the DISKCOPY program.

4-13
5. USING APPLICATIONS WITH MS·DOS
USING APPLICATIONS WITH .. S.DOS

HOW TO RUN APPLICATION PROGRAMS

MS-DOS lets you run many different application programs, including


spreadsheets, word processing programs, and graphics packages.
These application programs can help you in a number of ways. For
instance, they can help you balance a budget, figure income taxes, or
manage information, such as stocks, monthly reports, and address
lists.

Starting An Application From A Floppy Disk

Once you have started MS-DOS, you can run an application program,
as follows:

1. If drive "A:" is not the default drive

2. Put the application program disk in drive "A:" (the default drive)

3. Type the name of the application program you want to run

4. Press the ENTER key.

Example

Suppose you have a word processing application called PHRASE that


you want to use to write a monthly status report. To start PHRASE in
MS-DOS, you would follow these steps:

1. Make sure that the default drive is drive "A:" by typing the letter "A"
followed by a colon.

2. Type the name PHRASE (supposing PHRASE is the word used to


start the application).
3. Press the ENTER key to start PHRASE, which you could then use
to create, edit, format, or print your status report.

Starting An Application From A Hard Disk

If you want to run an application that is on your hard disk (drive "C:"),
follow these steps:

1. Change the default drive to "C:", the drive that contains the
application program.

2. Type the name of the application program you want to run.

3. Press the ENTER key.

Example

Suppose you have a graphics program called CANVAS stored in drive


"C:", and you want to use it to create a chart showing the current
month's sales data. To start CANVAS in MS-DOS, you would follow
these steps:

1. Change the default drive to drive "C:" by typing the letter "C",
followed by a colon.

2. Type CANVAS (supposing CANVAS is the word to start the


application ).

3. Press the ENTER key to start CANVAS.

You could then use CANVAS to create your chart.

Ms-DOS USER GUIDE


U.ING APPLICATION. WITH ...·DO.

A Note About Using Application Programs

After quitting some application programs, especially programs that use


a lot of memory, you may receive the following error message from
MS-DOS:

Invalid CO MMAND.COM
Insert disk with CO MMAND.CO M in drive d:
Re plac e and strike any key when ready

This message doesn't mean you have ruined your application program
or your computer. It occurs because your application used so much of
the computer's memory that it wrote over the MS-DOS
COMMAND.COM file. To fix the error, you simply reinsert a disk that
contains a copy of COMMAND.COM in the default drive (this
COMMAND.COM file must be the same version you used to start MS-
DOS) . You then press any key when you 're ready to continue using
your computer.

HOW TO CREATE A FILE WITH EDIT

MS-DOS includes a video file editing program called EDIT that lets you
create and edit files. EDIT is called a video file editor because it shows
you a full screen view of your file.

To help you learn how to use EDIT, the following section takes you
through a sample editing session in which you'll use EDIT to create a
small file. Suppose a client asks you to write a catchy advertisement
for an electric pencil sharpener, so you decide to create a file named
PENCIL.AD on the disk in the default drive. You want the file to contain
the following lines:

Introdu ci n g . . .
The X- 1 000 Automatic Pencil Sh arp e ner
From Sh ar p e Office S u pp l ies
The World Leader in Office Sh arpe ware
Creating A File With EDIT

The following example shows you how to start EDIT, create the
PENCIL.AD file, and save the file and exit EDIT. All you have to do is
follow these steps:

1. Make sure the MS-DOS disk is in drive "A:".

2. At the MS-DOS prompt, type the following command:

EDIT PENCIL.AD
then press the ENTER key

Since you are just creating the file, EDIT responds with the
following message:

OK to Create?

3. Press V (for Yes).

IIS-DOS USER GUIDE


USING APPLICATIONS WITH MS-DOS

You will see the following on your video screen:

rile: pencil. ad

+---+---+---+---+---+---+---+---+---+---+---+---+---+---

----------------- - --- - - TOP --------- - ------- - ----------


- ------ - -------------- BOTTOM - ----- - -------------------

Fig. 5-1 Initial EDIT Screen

4. Press the ENTER key.

5. Type the following lines. Remember to press the ENTER key after
each line, including the last line.

Intro du c i n g ...
Th e X - 1 000 Au to mat i c Penc i l Sh arpener
Fro m Sh ar p e Office S u ppl i es
The Wor ld Leader in Office Shar p e war e

Correcting mistakes in EDIT

Note: If you make a mistake when typing a line, use the


BACKSPACE key (+-) to erase the mistake before you press the
ENTER key. If you do press the ENTER key before correcting the
mistake, don't worry about it - you'll learn later how to correct a
previous lines.
Your screen should look like this:

f He: penc il. ad


+---+---+---+---+---+---+---+---+---+---+---+---+---+---

----------------------- TOP ---------- ------------------


Introducing ...
The X-IOOO Automatic Pencil Sharpener
from Sharpe Office Supplies
The World Leader in Office Shareware

---- ------------------ BOTTOM ----------------------- - --

Fig. 5-2 EDIT Screen After Input

6. If you made a mistake when typing a previous line, use the up


cursor key ( A until the cursor is on the line containing mistake.
),

You can then use the backspace (~) key to delete characters in
error. If you need to insert characters, press the insert key ( INS)
in the right hand pad: the cursor becomes a blinking square to
indicate character insertion mode. Then type the correct
characters.

7. To save the file and exit to MS-DOS press SHIFT F5 .

You now have a file named PENCIL.AD on the disk in your default
drive. If you type the MS-DOS DIR command, you should see an entry
for PENCIL.AD. You can also view this file by using the TYPE
command as follows:

TYPE PENCIL.AD
then press ENTER
To learn more about how to use EDIT, see the next chapter "The Video
File Editor (EDIT)"

Ms-DOS USER GUIDE


6. THE VIDEO FILE EDITOR (EDIT)
THE VIDEO FILE EDITOR (EDIT,

INTRODUCTION

EDIT is the MS-DOS Visual File Editor that you can use to create text
files and save them on disk. EDIT also allows you to update existing
files by deleting, changing and inserting text.

Text is displayed in a 21 line "window". This "window" can be moved


over any part of the file. Each text line in a newly created file can
contain up to 512 characters. Existing text files can be edited with
EDIT, however if a line contains more than 512 characters, the
characters after column 512 are overstruck on column 512.

EDIT can handle as large a file as permitted by the available memory.

THE EDITING SESSION

HOW TO INVOKE THE VIDEO FILE EDITOR

EDIT

Purpose To create, view or edit text file(s).

Category External

Syntax [drive:][path] EDIT [/B][/TJUR] pathname

Comments pathname indicates the path to the file, which is to be


edited .

8-1
If the IB switch is used a backup of the file is to be
made when the Video File Editor is entered . This
backup is named filename.BAK where filename is the
same as that specified in the command line.

If the IT switch is used the size of the file will be


minimized by automatically replacing multiple spaces
with TAB characters wherever possible.

The IR switch should be used if you only want to read


the contents of the file. This protects the file from
accidental damage while examining it.

Example Suppose you want to edit a file called NOTE1 on drive


"B :" in a directory called MEMOS. Then type:

EDIT B:\MEMOS\NOTE1
then press ENTER

Characteristics If the file does not already exist the following prompt
appears on the screen:

OK to Create?

You must reply Y (Yes) to create the file.

The Video File Editor is initially in "overstrike" mode.


That is, you can enter text and overwrite whatever is
written on the file. This indicated by a blinking "line"
cursor.

To change the mode to "insert" press the INS key.


That· is when you enter text, any text to the right of the
cursor will be pushed to the right by the inserted text.
However any text pushed past the right hand margin
will be lost.

MS-DOS USER GUIDE


THE VIDEO FILE EDITOR (EDIT,

HOW TO EXIT EDIT AND/OR SAVE FILES

Use the function keys to exit and/or save the file you are editing.

FUNCTION KEY MEANING

SlIIFT 1'5 Saves your fil e and exits to MS - DOS


(EXI'!' AND SAVE) or to the pr eviousl y edited file
(after using the EDIT command
" FILE " )

1'5 Saves the current e dit e d Eile , you


(SAVE TEXT) may continue editing.

SHIFT Fl Abort editing the current file,


(ABORT) without saving and exit to MS - DOS or
to th e previou sl y edited file (a fte r
u sing the EDIT command " FILE ")

IE text has b ee n altered or added


since starting the editor you are
asked to "C onri rm Abort?". To
confir m, pres s Y ror (Y es) . Any
other action causes t he Vid eo File
Editor to i gnore the ABORT.
THE DISPLAY

Once the Video File Editor has been invoked the monitor shows a
display such as the one shown in Figure 6-1 .

file text file Lines Read 10


+---+---+---+---+---+---+---+---+---+---+---+---+---+---

----------------------- TOP ----------------------------


This file contains text

.o
---------------------- BOTTOM --------------------------

Fig. 6-1 Video File Editor Screen Layout

Line 1 indicates the file name and the current message.

Line 2 is used for high level commands and search strings and is
therefore only used when in command mode. Refer to the section
entitled "Using the Editor Command Line" for details.

Line 3 shows the tab stop settings (4 character positions per tab).

Lines 4 to 24 contain the text window.

II&D08 USER GUIDE


THI VIDIO FILl IDITOR IIDIT)

Line 25 is not used.

On entering the Video File Editor the beginning and end of the file are
marked by two display lines containing the words TOP and BOTTOM,
respectively. The former, known as the TOP bar, always appears
immediately before the first line of text in the file. And the BOTTOM
bar always appears immediately after the last line of text. They are not
actual lines of text and are there merely as markers. The cursor is
initially positioned on the TOP bar.

The cursor changes shape when switching between certain modes of


editing. It is represented here as an underline.

Note that the screen mode for the Video File Editor is 80 x 25 lines,
even if it is invoked from a terminal set to 40 x 25 lines.
THE KEYBOARD

The keyboard functions in a different manner once the Video File Editor
has been invoked. This provides the means by which the required
editing functions are entered. The following tables show for each
function key, the function name and the key-stroke combination that
executes that function.

Using the Numeric Keypad

KEY - STROKE FUNCTION KEY NAME

HOME TOP

END BOTTOM

PGUP FULL SCREEN UP

PGDN FULL SCREEN DOWN

- CURSOR LEFT

-
t
CURSOR RIGHT

CURSOR UP

~ CURSOR DOWN

Using the Function Keys

Note that these function keys are summarized on a template supplied


with your system. Keep this template by your keyboard , for quick
reference during working sessions.

MS-DOS USER GUIDE


THE VIDEO FILE EDITOR (EDIT)

KEY-STROKE FUNCTION KEY NAM E

FI COMMAND MODE

SHIFT FI ABORT

F2 RESTORE LINES

SHIFT F2 DELETE LINE

F3 JOIN LINES

SHIFT F3 SPLIT LINE

\0'4 END OF LI NE

SHIFT F4 S'I'ART OF LINE

F5 SAVE

SHIFT F5 SAVE AND EXIT

176 NEXT LINE

SHIFT F6 ERASE TO END

F7 GOTO MARK

SHIFT F7 INSER'I' MARK

F8 SEARCH DOWN

SHIFT F8 SEARCH UP

F9 LINE DOWN

SH IFT F9 LINE UP
KEY ~ STROKE FUNCTION KEY NAME

FlO HALF SCREEN DOWN

SHIFT FlO HALF SCREEN UP

Using Control Keys

KEY ~ STROKE KEY FUNCTION NAME

CTRL H BACKSPACE

CTRL I TAB

CTRL K ERASE TO END

CTRL L REFRESH

CTRL R RECALL LINE

<~ BACKSPACE

INS INSERT MODE

DEL DELETE CHAR

ESC ESCAPE

TAB

SHIFT REVERSE TAB

ENTER INSERT LINE or EXECUTE COMMAND

M8-DOS USER GUIDE


THE VIDEO FILE EDITOR (EDIT,

USING THE EDITOR COMMAND LINE

The second line of the screen (above the scale line) is called the editor
command line and is used for entering high level commands and
search strings.

To enter text on the editor command line you must first press F1 (the
COMMAND MODE) function key. This moves the cursor to the second
line. You can now enter text there. All line editing operations - such as
INSERT MODE, BACKSPACE and DELETE CHAR - now apply to the
editor command line. The RECALL LINE function when used in
command mode restores the editor command line to its previous
contents. The ENTER key performs EXECUTE COMMAND when used
in this mode.

Repeating the COMMAND MODE key returns the cursor to the text
window without performing any command operation.

STRING SEARCHES

This feature enables you to search the file for a particular combination
of characters. Before searching for a text string you must enter
command mode by pressing F1 (the COMMAND MODE) function key.
Then enter the text to be searched for followed by the appropriate
function key, as described in the following table:
FUNCTION KEY MEA NING

1.'8 S"drc h es for the text stri ng starti ng


(SI':ARCH DO WN) from t h e t h e currenL c u rsor positio n
and moving do wn t h e file until t h e
first occurrence of the stri ng is
encoun ter e d. If found , the windo w
and cursor are mov ed to it .

SHIFT Fe Searc h es for the text strjng starting


(SEARCH UP ) fro m the c ursor position and moving
up the file . If the string is fou n d
then the windo w a n d cursor are moved
to it.

Examples

If you are editing the following text:

This is an example of how to use the search function keys of


the Video File Editor to find a particular combination of characters.
The Video File Editor is a highly functional program.

Search Down

1. Press F1 - the cursor will move to the "Command Line".

2. Type "func".

3. Then press F8 (Search Down) ."

The cursor will move under the "f" of "function in the above text.

4. Press F8 (Search Down) again.

The cursor will move under the "f" of "functional".

IIs.D08 USER GUIDE


THE VIDEO FILE EDITOII (EDIT)

Search Up

1. Press F1 - the cursor will move to the "Command Line".

2. Type "Editor".

3. Then press SHI FT F8 (Search Up)."

The cursor will move under the "E" of "Editor" in the last line of the
above text.

4. Press SHI FT F8 (Search Up) again .

The cursor will move under the "E" of the first instance of "Editor".

COMMANDS

The Video File Editor commands are a set of special commands that
enable you to perform a number of high level functions. Before
entering a command you must press F1 , the COMMAND MODE
function key. You can then type the command on the editor command
line. To execute the command you must then press the ENTER , the
EXECUTE COMMAND key.

GOTO

Purpose This command enables you to move the window to a


specific line number in the file.

Syntax GOTO line

Characteristics Each line of the text file is automatically numbered.


That is, the first line of the file is line 1, the TOP bar is
line 0 and the MARK bar does not count. The param-
eter line is a decimal number. which indicates which
line number in the file you want the cursor to move to.

8-11
If this number is greater than the number of lines in
the file then the window is moved to the end of the file.

DELETE

Purpose This command removes all text between the current line
and the MARK line and places the removed text in the
restore buffer from where it can be re-inserted at will. If the
MARK line does not exist an error message is given.

Syntax DELETE

FILE

Purpose The FILE command allows you to suspend processing


of the current file and invoke the editor on another file.
When editing of the new file is terminated by a SAVE
AND EXIT or ABORT function, the old file is recalled
at the point at which it was exited.

Syntax FILE pathname


Characteristics The parameter pathname gives the path and the
filename of the file to be edited.

The command line option switches ( IB, IT or IR )


used by the old file remain the same for the new file.

Editing of each file is kept entirely independent except


for the restore buffer, which enables the transfer of
lines of text from one file to another.

8-12
TN. VIDEO FILE EDITOR ,EDIT,

Further files can be entered and edited from the new


file using the FILE command. There is no limit to the
number of levels that can be created in this way
except that the text of all the files invoked must fit into
the available memory.

1-13
7. MS·DOS COMMANDS
MS-DOS COMMANDS

TYPES OF MS·DOS COMMANDS

There are two types of MS-DOS commands:

• Internal commands

• External commands

WHAT ARE INTERNAL COMMANDS?

Internal commands are the simplest, most commonly used commands.


When you list the directory on your MS-DOS disk, you cannot see
these commands because they are part of a file named
COMMAND.COM . When you type internal commands, MS-DOS
performs them immediately. This is because they were loaded into
your computer's memory when you started MS-DOS. Following is a list
of the MS-DOS internal commands:

BREAK CALL CHCP CHDIR CLS COPY CTTY


DATE DEL DIR ECHO EXIT FOR GOTO
IF MKD IR PATH PAUS E PROMPT REM REN
RMDIR SET SHIFT TIME TYPE VER VERIFY
VOL

Using Path names with Internal Commands

Some internal commands can use paths and pathnames. Specifically,


four commands - COPY, DIR, DEL, and TYPE - have greater flexibility
when you specify a pathname after the command .

The format of the COPY command is as follows :

COpy pathname pathname

7·1
If the second pathname is a directory (a path), MS-DOS copies all the
files you specify in the first pathname into that directory, as in the
following example:

COpy \USER\PETE\*.* SALES

The format of the DEL command is as follows:

DEL pathname

If the pathname is a directory (a path), all the files in that directory are
deleted. If you try to delete a directory, MS-DOS asks you:

Are you s u re ( y iN) ?

Type V (for Yes) to complete the command, or N (for No) to stop the
command. The following example deletes a file named NOTES.TMP in
the directory \USER\PETE on the "D:" drive:

DEL D:\USER\PETE

The format of the DIR command is as follows:

DIR pathname

The following command displays the files in the directory \USER\PETE


on the liD:" drive:

DIR D:\USER\PETE

The format of the TYPE command is as follows:

TYPE pathname

You must specify a filename for this command. MS-DOS then displays
this file on your screen in response to the TYPE command.

The following example would display the contents of the file


REPORT.NOV in the directory \USER\EMILY on the "D:" drive:

TYPE \USER\EMIL y\REPORT.NOV

7-2 II8-DOS USER GUIDE


.... DO. CO .... AND.

WHAT ARE EXTERNAL COMMANDS?

Any filename with an extension of .COM , .EXE, or .BAT is considered


an external command. For example, files such as FORMAT.EXE and
DISKCOPY.EXE are external commands. And because all external
commands are also fi les, you can create new commands and add them
to MS-DOS. Programs that you create with most languages (including
assembly language) will be .EXE (executable) files . Note, however,
that when you use an external command , you do not need to type its
filename extension.

Note: If you have more than one external command with the same
name, MS-DOS will run only one of them , according to the following
order of precedence: .COM, .EXE, .BAT.

To illustrate this precedence, suppose your disk contains the files


FORMAT.EXE and FORMAT. BAT. If you were to type the external
command format, MS-DOS would always run the program
FORMAT.EXE first, and not run the FORMAT.BAT file at all.

The following is a list of some of the external MS-DOS Commands:

APPEND ASSIG N ATTRIB BACKUP


CHKDSK COMMAND CO MP DISKCOMP
DISKCOPY F ASTOPE N FDISK FI ND
FORMAT GRAFT ABL GRAPHICS JOIN
KEYB LABEL MODE MORE
NLSFUNC PRI NT RECOVER REPLACE
RESTORE SELECT SHARE SORT
SUBST SYS TREE XTREE

7-3
USING PATHS WITH EXTERNAL COMMANDS

Before MS-DOS can run external commands, it must read them into
memory from the disk. When you give an external command, MS-DOS
immediately checks your working directory to find that command. If it
isn't there, you must tell MS-DOS which directory the external
command is in. You do this with the PATH command.

Using the PATH Command

When you are working with more than one directory, you may find it
more convenient to put all the MS-DOS external commands in one
directory. Then, when it needs them, MS-DOS can quickly find the
external commands at one location.

Suppose, for example, that you are in a working directory named


\USER\PROG and that the MS-DOS external commands are in \BIN.
To find the FORMAT command, you must tell MS-DOS to choose the
\BIN path, as in the following command, which tells MS-DOS to search
in your working directory and in the \BIN directory on drive "C:" for all
commands:

PATH=C:\BIN

You need only specify this path once during each computer session.
Also, if you want to know what the current path is, you can simply type
the PATH command by itself. In response, MS-DOS then displays the
working path on the screen .

You can automatically set your path when you start MS-DOS by
including the path command in a file called AUTOEXEC.BAT. For
more information on the AUTOEXEC .BAT file, refer to the "MS-DOS
Software Installation Guide".

MS-DOS USER GUIDE


...·DO. CO ....AND.

REDIRECTING COMMAND INPUT AND OUTPUT

Usually, MS-DOS receives input from the keyboard and sends its
output to the screen. You can, however, redirect this flow of command
input and output. For instance, you may want input to come from a file
instead of from the keyboard, and you may want output from a
command to go to a file or lineprinter instead of to the screen. With
redirection symbols, you can also create pipes that let the output from
one command become the input for another command.

How to Redirect Your Output

By default, most commands send output to your screen. If you want to


change this and send the output to a file, you just use a greater-than
sign (» in your command. For example, the following command
displays on the screen a directory listing of the disk in the default drive:

DIR

The DIR command can send this output to a file named CONTENTS if
you enter the following:

DIR > CONTENTS

If the contents file doesn't exist, MS-DOS creates it and stores your
directory listing there. If contents does exist, MS-DOS replaces what is
in the file with the new data.

Appending Output

If you want to append your directory or add one file to another (instead
of replacing the entire file), you can use two greater-than signs (») to
tell MS-DOS to append the output of the command (such as a directory
listing) to the end of a specified file. For example, the following
command appends your directory listing to an existing file named
contents:

DIR » CONTENTS

7-5
If CONTENTS doesn't exist, MS-DOS creates it.

How to Redirect Input

Often, it's useful to have input for a command come from a file instead
of from the keyboard. This is possible in MS-DOS by using a less-than
sign «) in your command. For example, the following command sorts
the file names and sends the sorted output to a file called NAMELlST:

SORT < NAMES> NAMELIST

FILTERS AND PIPES

MS-DOS Filter Commands

A filter is a command that reads your input, transforms it in some way,


and then outputs it to your screen. In this manner, the input is filtered
by the program .

MS-DOS filters include: FIND, MORE, and SORT. Their functions are
as follows:

FIND Searches for text in a file

MORE Displays the contents of a file one screenful at a time

SORT Alphabetically sorts the contents of a file

You can redirect the output from a filter into a file, or use it as input for
another filter by using pipes. The following section explains how filters
are piped together.

Command Pipes

If you want to use the output from one command as the input for
another, you can pipe the commands to MS-DOS. Piping is done by
separating commands with the pipe symbol (f). The following

Il&OO8 USER GUIDE


..S·DOS CO ..MANDS

command, for example, displays an alphabetically sorted listing of your


directory on the screen:

DIR: SORT

The pipe sends all output generated by the DIR command (on the left
side of the bar) as input to the SORT command (on the right side of the
bar).

Using Redirection Symbols with Pipes

You can also use piping with redirection symbols if you want to send
the output to a file. For example, the following command creates a file
named DIRECT.LST on your default drive:

DIR : SORT> DIRECT.LST

The DIRECT.LST file now contains a sorted listing of the directory on


the default drive.

You can also specify a drive other than the default drive. Suppose, for
example, you want to send the sorted data to a file named
DIRECT.LST on drive "B:". To do this you could simply type the
following:

DIR : SORT> B:DIRECT.LST

You can use more than one pipe on a command line. The following
command, for instance, sorts your directory, shows it to you one screen
at a time, and puts --More-- at the bottom of your screen when there is
more output to be seen:

DIR : SORT: MORE

Since commands and filters can be piped together in many different


ways, you will find many uses for them.

7·7
COMMAND CATEGORIES

The Category heading indicates whether the described command is:


"Internal" , "External" , "Non-network".

The meaning of "Internal" and "External" has been described earlier in


this chapter.

Non-network

This category means that the indicated command does not work over
OLiNET LAN . The following commands are "Non-network":

CHKDSK DISKCOMP DISKCOPY FASTOPEN


FDISK FORMA T JOIN LABEL
RECOVER SUBST SYS

Ms-DOS USER GUIDE


.... DO. CO .... AND.

NOTATION CONVENTIONS

The following notation conventions are uSed throughout this chapter:

• Uppercase, bold letters and words within a syntax line represent


keywords that must be typed exactly as shown.

Example

In the command line:

DISKCOPY [sourcedrive:] [targetdrive:]

DISKCOPY should be typed as shown.

Outside syntax lines, keywords are shown in uppercase but not in


bold .

Note that uppercase letters and words are used simply as visual
aids in this manual. Keywords may be typed in lowercase if
desired.

• Lowercase italicized characters and words represent parameter


names. They indicate that variable information is to be provided by
the user.

Example

In the command line:

DISKCOPY A: B:

both sourcedrive and targetdrive have been replaced by specific


values, that is A and B.

• A blank, a comma, a colon, or a semicolon may be used to


separate the items in a line. In this manual the blank is usually
shown in syntax lines.

• The symbols listed below are used to define the syntax of a line,
but should not be typed in the actual line:

7-9
[I brackets

{I braces

I vertical stroke ("or" sign)

ellipsis

• Items contained by brackets ([ )) are optional and so mayor may


not be selected.

Example

The representation:

[filespec]

indicates that a filespec mayor may not be entered .

• Items enclosed by braces ({ }) and separated by vertical strokes (I)


are alternatives. You should select only one such alternative.

Example

The representation:

{AlBIC}

indicates that either A or B or C should be selected.

• Items enclosed by brackets ([ )) and separated by vertical strokes


(I) are optional alternatives. You may choose one such alternative,
or none at all.

Example

The representation:

[AlBIC)

indicates that A or B or C may, but need not, be selected.

7·10 IIS-DOS USER GUIDE


...·DO. CO .... AND.

• An ellipsis indicates that the preceding item or group of items may


be repeated more than once in succession.

Example

The representation:

AlB) ...

indicates that A can be typed alone or can be followed by

B
more than once in succession .

• Letters and words in courier indicate MS-DOS messages that


appear on your Personal Computer screen. For example:

Insert ne w diskette for dri v e B :


and strike ENTER wh en ready

• Letters and words shown in narrow capitols indicate that you must
press a specific key. For example the key whose inscription is
CTRL is always referred to as CTRL.

• Commands need to be confirmed by typingJ (the ENTER key), at


the end of the command line.

7-11
COMMAND DESCRIPTIONS

APPEND

Purpose Sets a list of paths, which is used to search for data files.
APPEND can be extended to make all files in the search
path list appear to be in the current directory and/or for the
list of paths to appear in the environment.

Category External

Syntax 1 The first time APPEND is called , if you wish only to a


search path list for data files:

[drive:)[path)APPEND[=)[drive:)path[;[drive:]path) ...

Syntax 2 The first time APPEND is called, if you wish to extend the
way APPEND works:

[drive:)[path) APPEND [lX][IE)

If the /X switch is used commands such as COMP, DIR


and command execution will search for files, as specified
in a subsequent APPEND command , as if they were in the
current directory.

If the /E switch is used MS-DOS keeps the APPEND


search path list in the environment.

Syntax 3 Subsequent calls to APPEND:

APPEND[=][drive:]path[;[drive:]path) ...

7-12 Il&OO8 USER GUI)E


...·DO. CO .... AND.

Syntax 4 To display the list of appended directories:

APPEND

Syntax 5 To delete appended paths:

APPEND[=];

Examples

Example 1: Suppose you want to access data files in a directory called


LETTERS on drive "B:", and in a directory called REPORTS on drive
"A:". To do this, use the following command:

APPEND B:\LETTERS;A:\REPORTS

Example 2: Suppose you have a word processor which only works if


it's executable files and data files are in the current directory. The word
processor called PHRASE and it's overlays are in a directory called
PROGRAMS on drive "G:" and the data file MEMOIRS is in a directory
called TEXT on drive "D:". The current directory is root (\) on drive
"G:". To set up the APPEND search path list enter the following
commands:

1. APPEND IX
2. APPEND=G:\PROGRAMS;D:\TEXT

3. PHRASE MEMOIRS

The command in step 3 works as though PHRASE and MEMOIRS


were in the current directory. Indeed the internal command DIR will
give a listing of the files in the directories PROGRAMS and TEXT as
though they were in the current directory.

Warning

Do not use the MS-DOS 3.30 APPEND command with the OLiNET
LAN APPEND command.

7·13
ASSIGN

Purpose Instructs MS-DOS to route all requests from drive1 to


drive2. Drive assignments can be repeated on the
ASSIGN line.

Category External

Syntax [drive:][path] ASSIGN [drive1=drive2] ...

Comments The ASSIGN command lets you read and write files on
drives other than "A:" and "B:" for applications that use
only those two drives. You cannot assign a drive being
used by another program, and you cannot assign an
undefined drive. Do not type a colon after the drive letters
drive1 drive2.

Notes To ensure compatibility with future versions of MS-DOS


you should use the SUBST command instead of ASSIGN.
The following commands, therefore, are equivalent:

ASSIGN A=C

SUBST A: C:\

Since the ASSIGN command disguises the true device


type, you should not use ATTRIB:

• with commands that require drive information


(BACKUP, RESTORE, LABEL, JOIN, SUBST,
PRINT)

• during normal use of MS-DOS .

7-14 MS-DOS USER GUIDE


MS·DOS COMMANDS

Examples

If you want to run an application on a hard disk drive, "C:", and this
application requires you to put your program disk into drive "A:" and
your data disk into drive "8:", you would enter this command:

ASSIGN A=C B=C

All references to drives "A: " and "8:" would then go to drive "C:".

To reset all drives to their original assignments, type the following


command and press the ENTER key:

ASSIGN

ATTRIB

Purpose Sets or resets the read-only attribute and/or archive bit


attribute of file(s) in the current directory and optionally in
sub-directories.

Category External

Syntax [drive:][path]ATTRIB [+RI-R] [+AI-A]


[drive:]pathname [/S]

Where

+R sets the read-only attribute of a file.

-R disables read-only mode.

+A sets the archive attribute of a file.

-A clears the archive attribute of a file.

/S indicates the file(s) in the specified directory and


subdirectories will be processed.

7·15
Comments The ATTRIB command sets read-only andlor archive attri-
butes for files. You may use wildcards to specify a group
of files. The attributes of those files matching filename are
displayed or modified based on the switch selection.
ATTRIB doesn't accept a directory name as a valid
filename.

The drive and pathname specify the location of the file or


files you want to reference. The IS switch processes all
subdirectories as well as the path specified.

The BACKUP, RESTORE, and XCOPY commands use


the archive attribute as a control mechanism. You can use
the +A and -A options to select files that you want to back
up with the backup 1M command, or copy with the XCOPY
1M or XCOPY IA commands.
Notes If an application creates a file that has read and write per-
mission, ATTRIB forces read-only mode to allow file shar-
ing over a network.

Examples

Displaying File Attributes:

To display the attribute of a file called NEWS86 on the default drive,


you would type the following command:

ATTRIB NEWS86
then press ENTER

Setting Read-only Permissions:

The following command gives the file REPORT.TXT read-only


permission:

ATTRIB +R REPORT.TXT
then press ENTER

7·18 Ms-DOS USER GUIDE


...·DO. CO .... AND.

Setting a file as read-only prevents you from accidentally deleting or


modifying it.

To remove read-only permission from the files in the \USR\PETE


directory on drive B: , and the files in any subdirectories, you would type
the following command :

ATTRIB -R B:\USR\PETE IS
then press ENTER

Using The Archive Switch :

As a final example, suppose you want to give a co-worker a disk that


contains all files in the default directory of the disk in drive A, except for
files with the extension .BAK that contain old copies of edited files. To
copy these files to a disk in drive B:, you would type the following:

ATTRIB +A A:*.*
then press ENTER

then

ATTRIB -A A:*.BAK
then press ENTER

and

XCOpy A: B: 1M
then press ENTER

If you use the XCOpy 1M switch, XCOPY automatically turns off the
archive bits of the files in drive A: as it copies them.

7-17
BACKUP

Purpose Backs up one or more files from one disk to another.

Category External

Syntax [drive:][directory]BACKUP source-drive:[pathname]


target-drive: [IS] [1M] [I A] [IF] [lD:date] [IT:time]
[lL:[[drive:][path]filename))

Comments The BACKUP command can back up files on disks of dif-


ferent media (hard disks and floppy disks). BACKUP also
backs up files from one floppy disk to. another, even if the
disks have a different number of sides or sectors.

7·18 Ms-DOS USER GUIDE


liS-DOS COIlIiANDS

Option Switches

S WITCH PURPOSE

/S Backs up subdirectories.

/M Bac k s up only those files that have chang e d


since the last backup.

/A Adds the files to be backed up to those


already on t he backup disk. It does n ot
erase old fil e s o n the backup disk. This
switch will n ot be acce pt ed if files exist
t hat were back e d u p using ba ck up from MS - DOS
version 3.20 or earlier .

/F Causes th e targ e t disk to b e formatted if it


is n ot already. For this switch to fu n ction ,
the MS - DOS FORMAT co mm and must be accessible
by the current path .

/D : date Backs up only t hos e files that you last


modified on or aft e r date.

/1' : time Backs up only those files that you last


modified at or after time on the specifi e d
date. Time mu st be specifie d in 24 hour
clock forma t . See t he exa mp l e for the
correct forma t .

L: filename Makes a b ackup log e nt r y in th e sp e cifi e d


file . If you do n ot speci fy fil e n a me , BACKUP
places a file called BACKUP . LOG in the root
directory of t h e disk that co nt ai n s t h e files
being backed up_

7-11
Backup Log Files A Backup Log File uses the following format:

• The first line lists the date and time of the


backup.

• A line for each backed-up file lists the


filename and number of the, backup disk on
which the file resides.

• If the Backup Log File already exists,


BACKUP appends the current entry to the
file.

You can also use the Backup Log File when you
need to restore a particular file from a floppy disk,
but you must specify which disk to restore so that
the RESTORE command does not have to
search for files. The RESTORE command
always puts a file back in the same place from
which it was backed up. BACKUP displays the
name of each file as it is backed up. You should
label and number each backup disk consecutively
to help you restore the files properly with the
RESTORE command. If you are sharing files,
MS-DOS lets you back up only those files to
which you have access.

Notes You cannot use an old version of the RESTORE


command (MS-DOS Ver. 3.20 or earlier) for files
backed up with the MS-DOS Ver. 3.30 BACKUP
command.

Unless you use the fA switch, BACKUP erases


the old files on a backup disk before adding new
files to it.

You should not use the BACKUP command if the


drive you are backing up has been assigned ,
joined, or substituted with the ASSIGN, JOIN , or
SUBST commands. If you do, you may not be
able to restore the files with the RESTORE
command.

7-20 MS-DOS USER GUIDE


.... DO. CO .... AND.

Example

Backing Up Files:

Suppose Emily wants to back up all the files in the \USER\EMIL Y


directory on drive C: to a blank, formatted disk in drive "A:". To do this,
she would type:

BACKUP C:\USER\EMILY A: /0: 1-21-88 /T:13:00


then press ENTER

BREAK

Purpose Turns off or on the abort feature provided by CTRL C and


CTRL BREAK .

Category Internal

Syntax BREAK [ONIOFF]

Comments Depending on the program you are running , you may use
CTRL C to stop an activity (for example, to stop sorting a
file). Normally, MS-DOS checks to see whether you press
CTRL C while it is reading from the keyboard or writing to
the screen or printer. If you set BREAK to ON, you extend
CTRL C checking to other functions , such as disk reads and
writes.

Notes Some programs may set themselves to respond to CTRL C


at any time. Setting break does not affect these programs'
CTRL C checking.

7·21
Examples

To check for CTRL C only during screen, keyboard , and printer reads
and writes, type the following:

BREAK OFF
then press ENTER

To find out how BREAK is currently set, type:

BREAK
then press ENTER

CHOIR

Purpose Changes the current directory.

Category Internal

Syntax 1 CHOIR [drive:][path]

Syntax 2 CD [drive:][path]

Comments The CHOIR command changes your working directory to


the directory you specify. A shorthand notation for the
CHOIR command is CD.

Examples

Either of the following commands will change your current directory to


the directory called PRIMETIM:

CHOIR \PRIMETIM
then press ENTER

7·22 MS-DOS USER GUIDE


M8·D08 COMMANDS

or

CO \PRIMETIM
then press ENTER

To display the name of your working directory, simply type:

CO
then press ENTER

For example, if your working directory is \USER\PETE on drive B, and


you type the command :

CHOIR B:
then press ENTER

MS-DOS displays the following:

B:\USER \ PETE

Shortcuts There are two shortcuts you can use when you want to
change your directory to a parent directory or subdirectory
of your working directory. To illustrate, suppose you have
a directory called SPECIALS that has a subdirectory called
SPONSORS. So to change your working directory to
\SPECIALS\SPONSORS, you would type:

CD \SPECIALS\SPONSORS
then press ENTER

If your working directory is SPECIALS, you can type the


following command to change to the
\SPECIALS\SPONSORS directory:

CD SPONSORS
then press ENTER

Then , if you wanted to change your working directory back


to the parent directory, \SPECIALS, you could type this
command:

CD ..
then press ENTER

7-23
Type CD \ to return to the root directory. The root directory
is the highest-level directory on your computer and is
usually the directory that you see when you start MS-DOS.

CHKDSK

Purpose Scans the disk in the specified drive and checks it for
errors.

Category External, Non-network

Syntax CHKDSK [drive:][path] [filename] UF] UV]

Where

IF Fixes errors on the disk. If you do not specify this


switch, CHKDSK does not correct errors that it finds in
your directory. However, it does display messages
about files that need to be fixed.

IV Displays the name of each file in each directory as it


checks the disk.

Comments If you specify the IF switch, CHKDSK will show an error if it


finds any open files on the disk. If you do not specify the
IF switch and there are open files, CHKDSK may give
results that make it seem like there are lost clusters on the
disk. This happens when the File Allocation Table has yet
to be updated regarding open files. If CHKDSK reports a
large number of clusters as lost, you should consider
repairing the disk.

The CHKDSK command shows the status of your disk.


You should run CHKDSK occasionally on each disk to
check for errors. If you do run CHKDSK on a disk and any
errors are found, CHKDSK displays the error messages,
followed by a status report.

7-24 Ms-DOS USER GUIDE


MS-DOS COMMANDS

CHKDSK Status Report

A typical status report might look like this:

Volume SYS (3 3 0 ) created Dec 6 , 1987 9 : 20a


160256 bytes total disk space
8192 bytes in 2 hidden files
512 bytes in 2 directories
30720 bytes in 8 user files
121344 bytes available on disk

65536 bytes total memory


53152 bytes free

If you type a filename after CHKDSK, MS-DOS displays a status report


for the disk and for the individual file .

Notes CHKDSK does not correct errors on a disk unless you


specify the IF switch . For more information on CHKDSK
errors, refer to the specific error message in the booklet
"MS-DOS Messages". CHKDSK doesn't work on drives
used in the SUBST or JOIN commands.

CLS

Purpose Clears the screen.

Category Internal

Syntax CLS

Comments The CLS command clears your screen, leaving only the
MS-DOS prompt and a cursor.

7-25
Examples

Clearing your screen

You may find it more comfortable to work with a clean slate. If you
want to start a new process with a clear screen , type:

CLS
then press ENTER

COMMAND

Purpose Starts a new command processor.

Category External

Syntax [d:][path] COMMAND [drive:shel/path]


[cttydev][/E :nnnnn]UP]UC command-string]

Where shel/path is the pathname of a directory containing


COMMAND.COM

cttydev allows you to specify a different device (such as


AUX) for input and output.

IC command-string is a command to be passed to the new


command processor. This must be the last switch if used.

Comments This command starts a new command processor (the MS-


DOS program that contains all internal commands) . When
you start a new command processor, you also create a
new command environment. This new environment is a
copy of the old, parent environment. However, you can
change the new environment without affecting the old one.
The command processor is loaded into memory in two
parts: transient and resident. Some applications write over
the transient memory part of COMMAND.COM when they

7-21 Ms-DOS USER GUIDE


....DOS CO .... AND.

run. When this happens, the resident part of the command


processor looks for the COMMAND.COM file on disk so
that it can reload the transient part. The drive:shellpath
option tells the command processor where to look for the
COMMAND.COM file if it needs to reload the transient part
into memory.

Option Switches

SWITCH PURPOSE

IE: nnnnn Specifies the environment size , where n n n n n


is the size in bytes, ranging fro m 160 to
32,768 . MS - DOS round s this number u p to
th e next logical paragraph boundary. The
default value is 160 bytes .

Ip Keeps the secondary co mm an d processor in


memory and does not automatica lly return to
the primary command processor.

Ic comm-s t ring Tells the command processor t o perform the


command or co mm ands sp e cifi e d by string and,
then to return automatically to the primary
com mand processor.

Note If nnnnn is less than 160 bytes, MS-DOS defaults to 160


bytes and displays the following message:

Inv alid en vironment size specified

If nnnnn is greater than 32,768 bytes, MS-DOS displays


the same message, but defaults to 32,768 bytes.

For more information about the cttydev option , see the


CTTY command in this chapter.

7-27
Examples

Starting A New Command Processor

The following command tells the MS-DOS command processor to do


three things:

1. Start a new command processor under the current program

2. Run the command CHKDSK B:

3. Return to the first command processor

Type:

COMMAND IC CHKDSK B:
then press ENTER

COMP
--
- --
----

Purpose Compares the contents of two sets of files.

Category External

Syntax [drive:][path] COMP [pathname1[pathname2]]

Comments The COMP command compares one file or set of files


(pathname1) with a second file or set of files (pathname2) .
These files can be on the same drive or on different drives.
They can also be in the same directory or different direc-
tories. The two sets of files you want to compare can have
the same path and filenames - provided they are on dif-
ferent drives. If you type only a drive for the second option,
COMP assumes that pathname2 is the same as path-
name1. You can use wildcards (* and ?) to specify the
pathnames.

7-28 Ms-DOS USER GUIDE


.... DO. CO .... AND.

If you don't type the pathname options or if you omit the


pathname2 option , COMP prompts you for them. If either
option contains only a drive or a path with no filename,
COMP assumes the filename is *.*.

As COMP proceeds, it displays the paths and names of


the compared files. A message appears if COMP cannot
find a file matching the pathname2 parameter, or if a direc-
tory path is invalid. If no file matches the pathname1
option , COMP prompts you for both the pathname options
again .

Characteristics

During the comparison , a message appears for any location in the two
files that contains mismatching information. The message indicates the
offset into the files of the mismatching bytes and the contents of the
bytes themselves (all in hexadecimal notation) . The message has the
following format:

Compare error at OFFSET XXXXXXXX


filel XX
file2 = XX

In this format, file1 is the first filename typed ; file2 is the second
filename typed. After ten unequal comparisons, comp stops comparing
and displays the following message:

10 Mismatches - ending co mpare

If the file sizes are different, a comparison does not take place. After a
successful comparison, COMP displays the following message:

Files co mpare OK

After the comparison of the two files ends, COMP proceeds with the
next pair of files that match the two path name parameters, until no
more files can be found that match the pathname1 option. Then
COM P displays the following message:

Compare more files ( yiN ) ?

7-29
You now can compare two more files, or end the comparison. If you
want to compare two more files, type Y (for Yes) . COMP prompts you
for two new path options.

If, at the end of a comparison , the end-of-file marker cannot be found,


the following message will be displayed:

EOF mark not found

Examples

In the following example, COMP compares each file with the extension
.ASM in the current directory on drive C: with eac~ file of the same
name (but with an extension of .BAK) in the current directory on drive
B:

COMP C:*.ASM B:*.BAK


then press ENTER

COpy

Purpose Copies one or more files . Alternatively several files can be


concatenated and copied to a target file.

Category Internal

Syntax 1 To copy files

COpy source [! AI/B] [target][! AI/B][!V]

or

Syntax 2 To append files

COpy source 1[! AI/B]+source2[! AIIB]


[+source3[! AI/B] ... ] [target][! AI/B][!V]

Comments If you do not specify target, the copy is created in the

7-30 MB-DOS USER GUIDE


...·DO. CO .... AND.

working directory on the disk in the default drive. For sim-


ple copying the target file copy has the same name, crea-
tion date and creation time as the source file. If the origi-
nal file is on the default drive and you do not specify the
target file, the COPY command quits (you are not allowed
to copy a file to itself) , and MS-DOS displays the following
error message:

File cannot be copied onto itself


o File ( s) copied

Option Switches

S WITCH PURPOSE

/v Causes MS - DOS to verify that the sectors


written on the target disk are recorded
properly.

/A Lets you copy ASCII files . This s witch


applies to the filename prec e ding it, and to
all remaining filenames in the command, until
cop y e ncounters another /A or /B s witch.
This switch tells the command processor to
read until the en d -of-file mark.

/B Lets you co py binary files . This s witch


applies to the filename preceding it , and to
al l rema i ning filenames in the command, until
copy e n co unt ers another /A or /B s wit c h.
This s wit c h tells the co mmand proc essor to
read the n umb er of byt es specifjed by the
file size in the dire ctory.

If MS-DOS cannot verify a write, it displays an error message.


Although recording errors rarely occur with the COPY command, the IV
switch lets you verify that critical data has been correctly recorded; it

741
also causes the copy command to run more slowly, because MS-DOS
must check each entry recorded on the disk.

Using the IA and IB Switches


The COpy command switches IA and IB perform differently depending
on whether they are placed following the source filename or the target
filename.

When used with a source filename:

IA Causes the file to be treated as an ASCII (text) file. Data in the


file is copied up to but not including the first end-of-file mark (
CTRL Z) . The remainder of the file is not copied .
IB Causes the entire file to be copied, including any end-of-file
marks.

When used with a target filename:

IA Causes an end-of-file character to be added as the last character


of the file; for example:

COPY MEMO.DOC IA LETTER.DOC

IB Does not add an end-of-file character; for example:

COpy BILLlNG.ASM IB BILLlNG2.ASM

When you are combining files, the default switch is always IA. Do not
try to concatenate files if one of the source filenames has the same
name or extension as the target.

Copying Files and Subdirectories

If you want to copy all of a directory's files and subdirectories, you


shol:Jld use the XCOPY command. Refer to the XCOPY command in
this Chapter for more information.

7-32 MS-DOS USER GUIDE


MS-DOS COMMANDS

Examples

To copy a file called ANIMAL.TYP from your working drive and


directory to a directory on drive C: called BIGCATS, type:

COPY ANIMAL.TYP \BIGCATS


then press ENTER

Appending files: The COPY command also lets you concatenate files .
To do this, simply list any number of files as options to copy, each
separated by a plus sign (+) , and then specify a target file to send the
combined files to; for example:

COPY INTRO.RPT +BODY.RPT +B:SUM.RPT REPORT

This command concatenates files named INTRO.RPT, BODY.RPT,


and SUM .RPT (from drive B:) , and places them in a file called
REPORT on the default drive. When you are concatenating files, the
target file is created with the current date and time. If you omit the
target file, MS-DOS combines the files, and stores them under the
name of the first specified file.

Combining files: You can also combine several files into one by using
wildcards; for example:

COPY *.TXT COMBIN .DOC

This command takes all files with an extension of .TXT and combines
them into one file named COMBIN.DOC. In the following example,
each file that matches *.TXT is combined with its corresponding .REF
file. The result is a fi le with the same filename but with the extension
.DOC. Thus, FILE1 .TXT is combined with FILE1.REF to form
FILE1 .DOC, XYZ.TXT with XYZ.REF to form XYZ.DOC, and so on:

COpy *.TXT + *.REF *.DOC

The following copy command combines all files matching *.TXT and all
files matching *.REF, into one file named COMBIN .DOC:

COPY *.TXT + *.REF COMBIN.DOC

7-33
Copy compares the filename of the source file with the filename of the
target. If they are the same, that one input file is skipped, and MS-DOS
prints the error message:

Content of destination lost b e fore copy .

Further joining proceeds normally.

For example, the following command concatenates all *.TXT files


(except ALL.TXT) to ALL.TXT:

COPY ALL.TXT+*.TXT

This command will not produce an error message.

CTTY

Purpose Lets you change the device from which you issue com-
mands.

Category Internal

Syntax CTTY device

Where device specifies the device from which you are giving com-
mands to MS-DOS.

Comments CTTY is useful if you want to change the device on which


you are working.

Notes There are many programs that do not use MS-DOS for
input, output, or either. These programs send input directly
to the hardware on your computer. The CTTY command
has no effect on these programs; it affects only programs
that use MS-DOS.

7-34 Ms-DOS USER GUIDE


.... DO. CO .... AND.

Examples

Changing The Command Input And Output Device: The following


command moves all command I/O (input/output) from the current
device (the console) to an AUX port, such as another terminal:

CTTY AUX
then press ENTER

The next command moves I/O back to the console:

CTTY CON
then press ENTER

DATE

Purpose Enters or changes the date known to the system. This


command sets your computer's internal clock.

Category Internal

Syntax 1 USA
DATE [mm-dd-yy]

or

Syntax 2 Europe
DATE [dd-mm-yy]

Comments You can change the date from your terminal or from a
batch file. (MS-DOS does not automatically display a
prompt for the date if you use an AUTOEXEC.BAT file, so
you may want to include a DATE command in that file .)
MS-DOS records this date in the directory when you create
or change a file.

Remember to use only numbers when you type the date;

7-35
allowed numbers are:

mm 1 thru 12
dd 1 thru 31
yy 80 thru 99 or 1980 thru 2079

The date, month, and year entries may be separated by


hyphens (-) or slashes (I) or period (.). MS-DOS is pro-
grammed to change months and years correctly, whether
the month has 28, 29,30 or 31 days.

It is possible for you to change the mm-dd-yy format in


which the date is displayed and entered. The COUNTRY
command in the CONFIG.SYS file allows you to change
the date format to the European standard dd-mm-yy. For
more information on the CONFIG.SYS file, see the MS-
DOS Software Installation Guide.

Examples

Displaying the current date

If you simply type the DATE command, MS-DOS displays the following
message:

Current date is wee kd a y mm - dd - yy


Enter new date (mm - dd - yy):

Where weekday is the day of the week (for example, Tuesday). If you
do not want to change the date shown, press the ENTER key. Or you
can type a particular date after the date command, as in the following
example:

DATE 3-9-88
then press ENTER

In this case, the Enter new date: prompt does not appear after you
have pressed the ENTER key.

7-31 IIS-DOS USER GUIDE


.... DO. CO .... AND.

DEL

Purpose Deletes the specified file(s) .

Category Internal

Syntax 1 DEL [drive:]pathname

or

Syntax 2 ERASE [drive:]pathname

Comments Using Wildcards With DEL The DEL command lets you
use the * and? wildcards to delete more than one file at a
time. While convenient, this method of deleting files can be
dangerous, so use wildcards cautiously.

If you type:

DEL *.*
then press ENTER

this tells MS-DOS that you want to delete all the files in the
working directory. MS-DOS displays the prompt:

Are you sure?

If you type Y (for Yes) in response, MS-DOS deletes all


files in the working directory.

To delete all the files in another directory, type the DEL


command followed by the directory name.

Warning

Once you have deleted a file from your disk, you cannot recover it.

7-37
Examples

Deleting a file

The following command deletes a file named VACATION:

DEL VACATION
then press ENTER

If you have two files named VACATION.FEB and VACATION.APR, you


can delete them both with the following command:

DEL VACATION.*
then press ENTER

DIR

Purpose Lists the files in a directory.

Category Internal

Syntax DIR [drive:][pathname]UP]UW]

Comments The DIR command , typed by itself, lists all directory entries
in the working directory on the default drive. If you include
a drive name, such as B:, with the DIR command, all
entries in the default directory of the disk in the specified
drive are listed.

7-38 M&D08 USER GUIDE


liS-DOS COIIMANDS

Option Switches

SWIT CH PURPOSE

/p Se l ects page mode , ca u sing the directory


display to pause once the screen is filled.
To resume scrolling the display, press any
key.

/W Selects wide display and causes MS-DOS to


display only filenames and not ot h er file
information. The wide disp l ay l ists up to
five files per line .

Note

DIR lists all files with their size in bytes and the time and date of last
modification.

Note that the following DIR commands are equivalent, since you can
use the wildcards? and * in the pathname option:

This command Is equiva l e nt to

OIR OIR *.*


OIR filename OIR filename . *
OIR . ext OIR * . ext

If the COUNTRY command in the CONFIG.SYS file is set to a country


other than the United States, the directory date and time formats may
differ. For more information on the CONFIG .SYS file , see the MS-DOS
Software Installation Guide.
Examples

If your directory contains more files than you can see on the screen at
one time, enter the following:

DIR /P

This command displays the directory one screen at a time. As one


screen fills up, you can press any key to see the next screen of the
directory listing.

DISKCOMP

Purpose Compares the contents of the disk in the source drive to


the disk in the target drive.

Category External, Non-network

Syntax [drive:][path] DISKCOMP [source-drive:


[target-drive:]] [/1] [/8]

Comments DISKCOMP performs a track-by-track comparison of the


disks. It automatically determines the number of sides and
sectors per track based on the format of the source disk.

7-40 MS-DOS USER GUIDE


.... DOS COMMANDS

Option Switches

SWITCH PURPOSE

/1 Ca us es DISKCOMP to compare just the first


si de of the disk, eve n if the disks and
driv es th a t y o u ar e u s ing are d o ubl e - s id ed.

/8 Causes DI SKC OMP to co mp are just t h e fi rs t 8


sec Lors p er Lrack , e v e n if the disks con Lain
9 or 15 sectors p er tr ac k .

Remarks

If you specify only one drive, DISKCOMP uses the default drive as the
target drive. If you specify the same drive as the source and target ,
DISKCOMP does a comparison using one drive, and prompts you to
insert the disks as appropriate. If all the tracks are the same,
DISKCOMP displays the message:

Compare OK

If the tracks are not the same, DISKCOMP displays a Compare error
message that includes the track number and side number (0 or 1)
where it found the mismatch. If the target disk is not the same type as
the disk in the source drive, DISKCOMP displays the following
message:

Drive types or d iskette types not compatible

When DISKCOMP completes the comparison, it prompts you with the


following message:

Compare another disk ette (yiN) ?

7-41
If you type Y (for Yes), DISKCOMP prompts you to insert the proper
disks and does the next comparison. If you type N (for No), DISKCOMP
ends. If the disk in the default drive does not contain MS-DOS and you
end DISKCOMP, you'll receive the following message:

Insert disk with COMMAND . COM in drive A


and strike any key wh en ready

DISKCOMP does not work on network drives, and you cannot use it
with assigned, joined, or substituted drives. If you attempt to use the
DISKCOMP command with these types of drives, it displays an error
message.

Note

When comparing a disk with a backup disk that you made with the
COPY command, you may receive the Compare error message, even if
the files on the disks are identical. This is because the COPY
command duplicates the information, but doesn't necessarily place it in
the same location on the target disk. In this case, you should use the
COMP command to compare individual files on the disk. For more
information, see the COMP command later in this chapter.

DISKCOMP does not work on network drives, and you cannot use it
with ASSIGNed, JOINed, or SUBSTituted drives. If you try to use the
DISKCOMP command with these types of drives, an error message will
appear.

Example

Comparing Two Disks: If your computer has only one floppy disk
drive, drive A:, and you want to compare two disks, you can simply type
the following command, from the A: > prompt:

DISKCOMP

MS-DOS prompts you to insert each disk, as required.

Ms-DOS USER GUIDE


liS· DOS COMMANDS

DISKCOPY

Purpose Copies the contents of the floppy disk in the source


drive to a formatted or unformatted floppy disk in the
target drive.

Category External , Non-network

Syntax [drive:][path] DISKCOPY [source-drive:]


[target-drive:] [/1]

Comments source-drive and target-drive may be the same. If


you omit the drive options, MS-DOS prompts you for
the drives. If the target disk is not formatted ,
DISKCOPY formats it with the same number of sides
and sectors per track as the source disk.

Option Switch The /1 switch allows you to copy only one side of a
disk.

Warning The DISKCOPY command works only with floppy


disks. You cannot use DISKCOPY with a hard disk.

If you omit both options, MS-DOS performs a single-


drive copy operation on the default drive. If you omit
just the second parameter, MS-DOS uses the default
drive as the target drive. In either case, though,
DISKCOPY destroys the contents of the target disk.

Diskcopy prompts you to insert the source and target


disks at appropriate times and waits for you to press
any key before continuing.

After copying , DISKCOPY then prompts you with the


following message:

Copy another diskette ( yiN)?

If you type Y (for Yes) , MS-DOS prompts you to


insert source and target disks, and performs the next

7-43
copy on the drives that you originally specified .

To end the DISKCOPY process, type N (for No).

Example

Copying A Disk To copy the disk in drive "A:" to the disk in drive "B:",
use the following command:

DISKCOPY A: B:
then press ENTER

DISKCOPY prompts you to insert both disks and press any key to
begin copying.

ERASE

Purpose Deletes the specified file(s) . See the "DEL" command.

EXIT

Purpose Exits from a secondary command processor and returns


to a parent program or command processor, if one
exists.

Classification Internal

Syntax EXIT

Comments If you use the MS-DOS command program to start a


new command processor, you can use the EXIT com-
mand to return to the old command processor. Also,

7-44 MIW)OS USER GUIDE


...·DO. CO .... AND.

while running an application program , you can exit to the


MS-DOS command processor. and then return to your
program.

For more information about command processors, see


the COMMAND command earlier in this chapter.

Examples

If you start a new command processor by typing the following


command:

COMMAND
then press ENTER

You can then return to the previous command processor by typing:

EXIT
then press ENTER

FC

Purpose Compares two files or two sets of files and displays the
differences between them.

Category External

Syntax 1 For ASCII comparisons:

[drive:][path] FC U#]Ua]Uc]UIJUnJUtJUw]
Ulb length]pathname1 pathname2

Syntax 2 For binary comparisons:

[drive:][path] FC [#JUb] pathname1 pathname2


Where pathname1 is the first file that you want to compare. path-
name2 is the second file that you want to compare.

Note See the "MS-DOS Quick Reference Guide" for a definition


of the option switches.

Example

Comparing text files

Suppose you want to compare two text files called MONTHLY.RPT and
SALES.RPT. To make this comparison, you would enter the following
command line:

Fe /a MONTHL V.RPT SALES.RPT


/a Abbreviates the output of an ASCII comparison. Instead of
displaying all the lines that are different, FC displays only the lines
that begin and end each set of differences.

FIND

Purpose Searches for a specific string of text in a file or files .

Category External

Syntax [drive:][path] FIND UV] UC] UN] "string"


[pathname] ...

Where string is a group of characters you want to search for.

Comments The FIND command looks for string in one or more files.
After searching the specified files , FIND displays any lines
it has found that contain the specified string.

String must be enclosed in quotation marks. Uppercase

7-41 M8-DOS USER GUIDE


"S-DOS CO .... ANDS

characters in string will not match lowercase characters.

Put in two sets of quotes where the string itself contains


quotes. That is:

FIND "th is is a quote ("")"

finds the string this is a quote(").

If you omit pathname, find acts as a filter. It takes input


from the MS-DOS standard input (usually from the key-
board, a pipe, or redirected file) and displays any lines that
contain string.

Wildcards (* and ?) are not allowed in filenames or exten-


sions.

Option Switches

S WI'T'CH PURPOSE

Iv Displays all lines not containing the


specifie d string .

IC Displays only t he numb er of lines t hat


co n tain a match in each of the files.

IN Precedes eac h line wi th its relative line


nu mb er in the file.

7-47
If you specify the IC switch with the IV switch, FIND displays the
number of lines that do not contain the string you typed. If you specify
the IC switch with the IN switch, find ignores the IN switch.

Examples

Finding A String Of Text In A File: The following command displays


all lines from the file PENCIL.AD that contain the string Pencil
Sharpener:

FIND "Pencil Sharpener" PENCIL.AD

Finding Files That Do Not Contain A String: The next command


causes MS-DOS to display the names of all files on the disk in drive B:
that do not contain the string date:

DIR B: I FIND IV "date"

Finding A File Which Contains A Quotation: The following


command finds the string, The dentist said, "Open wide!", in the file
STORY.DOC, type the following command:

FIND "The dentist said, ""Open wide!""" STORY.DOC

FORMAT

Purpose Formats the disk in the specified drive to accept MS-DOS


files .

Category External, Non-network

Syntax [drive:][path] FORMAT drive: [!1][!4][!8][!VJUS][!B]


[!N:xx][!T:yy]

Comments The FORMAT command creates the directory and the file
allocation tables on a disk. You must use this command to
format all new disks before MS-DOS can use them.

7-48 Ms-DOS USER GUIDE


...·DO. COIlIiAND.

You must specify the drive that you want to use to format a
disk. Format then uses the drive type to determine the
default format for a disk.

Warnings Formatting destroys any previously existing data on a disk.

It ignores drive assignments created with the ASSIGN


command.

Option Switches

The FORMAT command accepts the following switches:

SWITCH PURPOSE

/1 For mats a si ngl e - side of the floppy disk.

/4 Formats a 5 - 1/4 - inch, double -s id e d di s k in a


high -ca pacity dis k driv e. If you are u si ng a
sing l e- or doubl e - side d drive , you may n ot be
able to reliably read disks formatted with
this s wi tch.

/8 For mats eig h t sectors per track.

/B Formats the disk , leaving ample s pac e to cop y


an operating syste m, such as MS - DOS 3 . 3 0 .
--------------------------------------------------------~~

7-41
SWI TCH PURPOSE

/S Copies th e op era t i ng system fil es fro m the


disk in the default driv e to the n e wly
formatt e d disk. Th e n e wly formatted disk
must be 1. 2 mega byt es or gr eater in size ;
otherwis e , PORMAT rejects the co mm a nd . If
the operating syste m is not o n t h e d efa ult
drive , FORMAT p ro mpts you to ins ert a syste m
disk in the d efa ul t drive (or in d ri v e A : if
the default d ri v e is non - r e movab le ) .

/T : trac k Specifies the nu mb er of tra c ks on the disk.


Th is s witch formats 3 - 1/2-inch f loppy di s k to
the numb er of tracks specifi e d. For
72 0 K- byt e di s ks and 1.44 - mega by te di s k s , t his
valu e is 80 (jT: 80 ) .

/ N: sector Specifies the numb er of sectors p er track .


This s witch formats a 3- 1 /2-i n c h d isk to the
number of sectors specified. For 72 0K - byte
disks , thi s v al u e is 9 (jN:9).

/v Caus es forma t to prompt you for a v o lu me


lab e l for th e disk yo u are formatting. A
volume lab e l i d e n tif i es the di sk a nd can be
up to 11 c ha r a cters in leng t h (no ta b s
allowed ) . An exa mple of a volum e label is
" PROGRA MS " .

Formatting a Hard Disk

See the "MS-DOS Software Installation Guide" .

IIS-DOI USER GUIDE


"S-DOS CO .... ANDS

Note

You should not use the FORMAT command with drives used in the
ASSIGN , JOIN , or SUBST commands, and you cannot FORMAT
drives over a network. For more information about disk volume labels,
see the DIR , LABEL, and VOLUME commands in this chapter.

The following table shows which switches you can use for certain types
of disks:
Disk type Valid switches

160/180K bytes /l 14 18 IE IN IT Iv Is
3201360K bytes 11 14 18 18 IN IT Iv Is
7 20K bytes IN IT Iv I s
1.2 megabytes IN IT Iv I s
1. 44 mega byt es IN IT Iv Is
hard disk Iv I s

Examples

Formatting a floppy disk

To format a floppy disk in drive A: and ,copy the operating system to it,
type the following command:

FORMAT A: /S
then press ENTER

To format a floppy disk in drive A: for use with data, type:

FORMAT A:
then press ENTER

7-51
GWBASIC

Purpose Enters the MS GW-BASIC interpreter.

Category External

Syntax [d:][path] GWBASIC

Remarks For more information on how to initialize GW-BASIC see


the "MS GW-BASIC Interpreter under MS-DOS User
Guide".

JOIN

Purpose Joins a disk drive to a specific path.

Category External, Non-network

Syntax 1 To join:

[d:][path] JOIN connected-drive splice-drive:\splice-directory

Syntax 2 To deassign a join:

[d:][path] JOIN connected-drive /0

Syntax 3 To find out which drives are joined:

[d:][path] JOIN

Comments With the JOIN command, you don't need to name physical
drives with separate drive letters. Instead, you can refer to
all the directories on a specific drive with one path. If the
path already existed before you gave the JOIN command,
you cannot use it while the JOIN is in effect. Also, you

7-12 MS-DOS USER GUIDE


...·DO. CO .... AND.

cannot join a drive if it is being used by another process.

If the path does not exist, MS-DOS tries to make a direc-


tory with that path. After you give the JOIN command , the
first drive name becomes invalid, and if you try to use it
MS-DOS displays the Invalid drive error message.

Notes The following commands do not work on drives used in the


JOIN command:

CHKDSK LABEL
DISKCOPY RECO VER
FDISK SYS
FORMAT

Example

Joining a drive: You can join a drive only with a root level directory.
For example, this command will work:

JOIN D: C:\SALES

But the following one will not:

JOIN D: C:\SALES\REGIONAL

LABEL

Purpose Creates, changes, or deletes the volume label on a


disk.

Category External, Non-network

Syntax [drive:[path] LABEL [drive:][Iabe1

Where label is the new volume label, which may be up to 11


characters in length.
Comments A volume label is a name you can specify for a disk.
MS-DOS displays the volume label of a disk as a part
of its directory listing to show you which disk you are
using.

If you do not specify a label, LABEL prompts you with


the following message:

Volum e in drive x is xxxxxxxxxx


Type a volume l abel of up to 11 characters or
press Enter for no volume lab e l updat e :

Naming volume A volume label may be up to 11 characters in length


and may include spaces, but not tabs. Type the
volume label that you want and press the ENTER key.
Or, you can press the ENTER key immediately if you
want to delete the volume label. Label will prompt you
with the message:

Delete current volume label ( yiN ) ?

If you type Y (for Yes) , LABEL deletes the volume


label on the disk. Otherwise, the volume label stays
the same.

Notes You can use the MS-DOS DIR or VOL command to


determine if the disk already has a volume label.
Label doesn't work on drives involved with SUBST or
JOIN commands. Do not use any of the following
characters in a volume label:

*?I I ., ; :+ =<> [] ()&~

Examples

Labeling a disk: To label a disk in drive A: that contains sales


information for 1987, you might type:

LABEL A:SALES1987
then press ENTER

MS-DOS USER GUIDE


...·DO. CO .... AND.

MKDIR

Purpose Makes a new directory.

Category Internal

Syntax 1 MKDIR [drive:]path

Syntax 2 MD [drive:][path]

Comments The MKDIR command lets you create a multilevel directory


structure. Remember, however, that directories created
with MKDIR are always subdirectories of your working
directory unless you explicitly specify a different path with
the MKDIR command.

Examples

Creating a subdirectory If you want to create a directory to keep all


your tax information, you could type the following command from your
root directory:

MKDIR \TAXES
then press ENTER

Now, suppose you want to create a directory named rental under the
TAXES directory to keep track of information about an apartment that
you rent out. To do this from the root directory, you simply type the
following command:

MKDIR \TAXES\RENTAL
then press ENTER

To create the same subdirectory from the \TAXES directory, you could
type either the previous command, or

MKDIR RENTAL
then press ENTER

7-55
MORE

Purpose Sends output to the console one screen at a time.

Category External

Syntax [drive:][path] MORE

Comments MORE is a filter that reads from standard input (from a


pipe or redirected file) and displays one screen of informa-
tion at a time. MORE is commonly used to view long files.

Example

For example, you may use the DIR command, the SORT command or
a filename as a source. The more command then pauses and displays
the --More-- message at the bottom of your screen.

Press any typing key to display another screen of information, then


keep pressing it until you have read all the data.

Notes

To hold input information until it is displayed, the MORE command


creates a temporary file on the disk. If the disk is full or write-protected,
MORE will not work.

Examples

Viewing long files: Suppose you have a long file called


CLIENTS. NEW that you want to view on your screen. The following
command redirects the file through the more command to show the
file's contents one screen at a time:

MORE < CLiENTS.NEW


then press ENTER

Ms-DOS USER GUIDE


MS-DOS COMMANDS

If you have a long file of customers you could use the MORE command
to view it one screen at a time. Suppose this file is called
CLiENTS.NEW. To see it, you would just type the following command :

TYPE CLIENTS. NEW I MORE


then press ENTER

PATH

Purpose Sets a command search path in the environment.

Category Internal

Syntax PATH=[;I[Pathname[;pathname) ...)

Characteristics

Where pathname is the path of a directory you wish MS-DOS to


search, including optionally a drive letter. Do not include a filename.

PATH tells MS-DOS which directories, and in what order, to look for
external commands after it has searched your current directory.

You can specify a single directory path or a number of paths each


separated by a semicolon (;). The default is no search path; in this
case MS-DOS only searches your current directory.

If you enter PATH with no parameter, MS-DOS displays the current


search path. If you enter PATH; any previously established path is
cancelled and only your current directory is searched .

You only need to set the search path once in any terminal session.

Path only finds executable files : e.g . .COM , .EXE, .BAT files. Path
ignores files with any other extension. The paths are searched in the
order specified, so place the most frequently accessed directories first.

7-57
Non-existent directories specified in the PATH variable in the
environment are ignored.

Example

The following command tells MS-DOS to search three directories to


find external commands (the three paths for these directories are
D:\USER\PETE, D:\USER\EMILY and C:\BIN):

PATH=D:\USER\PETE;D:\USER\EMILY;C:\BIN

PRINT

Purpose Queues test files for background printing, while other MS-
DOS commands are obeyed.

Category External

Syntax 1

The first time PRINT is called

[d:)[path) PRINT [/O:device) [/B:buffsize) [/U:busyticks)


[/M:maxticks) [/S:timeslice] [/Q:queuesize) [[pathname) ... )

Syntax 2

Subsequent calls to PRINT

[d:)[path) PRINT [[/Cl/P][[pathname) ... ]][/Cl/P) ...

MS-DOS USER GUIDE


MS-DOS COMMANDS

Syntax 3

Subsequent call to terminate PRINT

[d:][path] PRINT UT]

Where

SYNTAX ELEMENT MEANING

d Specifies the drive where PRINT is to


be found.

path Specifies the directory where PRINT


is to be found.

pathname The file specification of a file to


be printed, optionally preceded by
the drive and the path leading to the
directory where the file is to be
found.

/D:device Use to specify the print de v ice. If


not used PRINT will specify for a
print device .

/B:buffsize Use to set the internal print buffer


size in bytes. The normal size is
512 bytes . Increasing the size may
increase performance .

/U:busyticks Specifies the number of MS-DOS clock


ticks that PRINT will wait if the
printer is busy . Otherwise PRINT
gives up its timeslice. The default
is 1 tick.
----------------------------------------------------------~~
SWITCH PURPOSE

/M:maxticks Specifies ho w many MS - DOS clock ticks


pri n t can h ave to print a file.
Maxticks ca n be fro m 1 to 255 clock
ticks (t h e defaul t i s 2).

/S : ti mes lic e Specifies the time slice value.


timeslice can b e fro m 1 to 255 (the
default is 8). Th e lo wer the value
the hig h er the priority of the print
que u e.

/Q:queuesize Specifies the number of files allo we d


in t h e print que u e . qu e u esize can b e
fro m 1 to 32 ( the default is 10 ) .

Comments

You can use the PRINT command only if you have an output device,
such as a printer or a plotter, connected to one of your computer's
serial or parallel ports.

Characteristics

You may use global and wildcard characters.

When you run PRINT for the first time in a terminal session, you are
prompted as follows:

Name of list de v ice [PRN: ]

Type the name of a valid line printer device driver, or simply press
ENTER to accept the default line printer device PRN:.

MS-DOS USER GUIDE


...·DO. CO .... AND.

The following switches are possible with this command:

S WI T CH MEANING

IT TER MINATE: t h is s witc h ca n ce l s all files in


t he print queu e (those waiti n g to be
printed ). A message to t hi s effect will be
printed.

Ic CA NC EL: This s witch turns on ca nc el mode.


The p recedi n g files p ec and all follo wing
filespecs wi l l be s u spen d ed in the p ri nt
qu e u e un ti l Ip switch is e n co unt ered o n t h e
co mm a nd lin e .

II' PRI NT: Th is s witc h t u r n s o n print mod e . The


prece ding filespec and all followi ng
ri I cspecs will b e added to t he print qu e ue
utiLi l a i C s wi tc h is encount ere d on t h e
co mm a nd line.

PRINT with no parameters displays the contents of the print queue on


your screen without affecting the queue.

Examples

The following command empties the print queue for the device named
LPT1:

PRINT IT ID:LPT1
then press ENTER

The following command removes the PENCIL.TST file from the default
print queue:

PRINT A:PENCIL.TST IC
then press ENTER

The next two commands show how to remove the file PENCIL.TST

7-81
from the queue and then add the file pen .tst to the queue:

PRINT PENCIL.TST IC
then press ENTER

PRINT PEN.TST IP
then press ENTER

PROMPT

Purpose Changes the MS-DOS command prompt.

Category Internal

Syntax PROMPT [[text][$charac;ter] ... ]

Comments This command lets you change the MS-DOS system


prompt (for example, A» . If, when using the prompt com-
mand, you do not type a new value , the prompt is set to
the default value, which includes the default drive name.

Special Prompts

You can use the characters in the prompt command to create special
prompts:

Type th ese To get this prompt


c haract ers

$q The = character
$$ The $ character
$t The current time
$d The current date
$p The working directory of the
d efa ult drive
$v Th e version number

II8-D08 USER GUIDE


MS·DOS COMMANDS

Type these To get this prompt


c haracters

$n The d efa ult driv e


$g The > character
$1 The < chara cter
$b The I character
$ A carriage return - linefe e d se qu e n ce
$e ASCII ( Hexad eci mal 1B)
$h Backspace (to erase a character
that has been written to the
prompt line)

Examples

Setting your prompt

The following example sets the drive prompt to drive:\current directory:

PROMPT $P
then press ENTER

The following command sets a two-line prompt that displays the


following:

Time (current time)


Date (current date)

PROMPT TIME = $T$ DATE = $0


then press ENTER -

RENAME

Purpose: Changes the name of a file.

Category Internal

Syntax REN[AME] [drive:][path]old_file new_file


Comments The REN command renames all files matching old_file.

You may use wildcards (* or ?) in either filename parame-


ter. If wildcards appear in the second parameter, the
corresponding characters in the first parameter remain
unchanged.

Examples

Renaming files

The following command changes the extension of all filenames ending


in .TXT to .DOC:

REN *.TXT *.DOC


then press ENTER

In the next example, REN renames a file named CHAP10 (on drive B:)
to PART10:

REN B:CHAP10 PART10


then press ENTER

The newly renamed file PART10 remains on drive B:.

REPLACE

Purpose Updates or adds files according to the criteria set by the


option switches. You cannot use the REPLACE command
to update hidden files or system files.

Category External

Syntax [drive:][path] REPLACE [source-drive:][source-path]


source-file [target-drive:][target-path] UAJUPJURJUSJUW]
.... DO. CO .... AND.

Comments The REPLACE command performs two functions :

• It replaces files in the target directory with files in the


source directory that have the same name.

• When you specify the fA switch, REPLACE adds files


that exist in the source directory (but not in the target
directory) to the target directory.

You may use wildcards in the source-file name.

If you use more than one option switch with the REPLACE command,
there must be a space between the option switches.

Example

REPLACE A:*.* B: fS fW fP
Option Switches

SWITCH P URPOSE

/A Adds new files to the target directory


instead of replacing existing ones. You may
not use this s wit ch with the /S switch.

/p Prompts you with the following message before


it replaces a target file or adds a source
file:

Replace filename? (Y/N)

/R Replaces read - only files as well as


unprotected files. If you do not specify
this s wit ch, any attempt to replace a
read-only file causes an error and stops the
replace process.

/S Searches all subdirectories of the target


directory wh ile it replaces matching files.
This switch is incompatible with the /A
switch. Replace never searches
subdirectories i n the source path.

/W Wai ts for you to insert a disk before


beginning to search for source files. If you
do not specify the /W switc h, REPLACE begins
replacing or adding files immediately.

If you specify IW but not lA, REPLACE displays the following message:

Press any key to begin replacing files

Ms.DOS USER GUIDE


...·DO. CO.... AND.

If you specify both the IW and I A switches, replace displays the


following message:

Press any key to begin adding file ( s )

As files are replaced or added , REPLACE displays their filenames on


the screen. At the conclusion of the replace operation, it displays a
summary line:

nnn file ( s ) added / replaced

or

No files added/replaced

Examples

Replacing Files

Suppose various directories on your hard disk, drive C:, contain files
named PHONES.CLI that contain client names and phone numbers. To
update these files and replace them with the latest version of the
phones.cli file on the disk in drive A, you would type the following
command:

REPLACE A:\PHONES.CLI C:\ IS


then press ENTER

This command replaces every file on drive C: that is named


PHONES.CLI with the file PHONES.CLI from the root directory on drive
A:.

Adding Files

Suppose you want to add some new printer device drivers to a


directory called C:\MSTOOLS , which already contains several printer
driver files for a word processor. To do this, you would type the
following:

REPLACE A:*.PRD C:\MSTOOLS IA


then press ENTER

7-87
This command searches the default directory of drive "A:" for any files
that have the extension .PRD (that don't currently exist in the
\MSTOOLS directory on drive C:) and then adds these files to
C:\MSTOOLS.

RESTORE

Purpose Restores files that were backed up using the BACKUP pro-
gram.

Category External

Syntax [drive:][path] RESTORE source-drive:[target-drive:]


[pathname]US]UP][/B:date]UA:date]UE:time]UL:time][/M] UN]

Option Switches

SWITCH PURPOSE

IS Restores subdirectories also.

Ip Prompts for permission to restore any files


matching the file specification that are
read - only or that have changed since the "last
backup.

IB:date Restores only those files last modified on or


before date.

IA:date Restores only those files last modified on or


after date .
------------------------------------------------------~~

M8-008 USER GUIDE


...·DO. CO .... AND.

SWITCH PURPOSE

IE:time Restores only thos e files last modified at or


ea rlier than time .

IL:time Res tores only thos e files last modified at or


later than time.

1M Restores only thos e files modifi e d since the


last backup.

IN Restores only thos e files that no long er


e xist on the target disk.

Once MS-DOS has restored the file, use the DIR command to make
sure that the file was restored properly.

Note

RESTORE cannot restore system files. Use the SYS command to


restore these files .

The MS-DOS Ver. 3.30 RESTORE command will restore files backed
up with either the MS-DOS Ver. 3.30 BACKUP command , or an earlier
version of BACKUP.

Examples

Restoring a File

To restore the file INVEST.MNT from the backup disk in drive A: to the
\IRSHARPE directory on drive C:, type the following:

RESTORE A: C:\IRSHARPE\INVEST.MNT
then press ENTER

Press the ENTER key to let MS-DOS know that the backup disk is in
drive "A:".
RMDIR

Purpose Removes an empty sub-directory.

Category Internal

Syntax 1 RMDIR [drive:]path

Syntax 2 RD [drive:]path

Comments RMDIR removes a directory that is empty except for the .


and .; special files. These two symbols refer to the direc-
tory itself and its parent directory, respectively. Before you
can remove a directory entirely, you must delete its files
and remove it's subdirectories.

Examples

Removing a Directory

Suppose you want to remove a directory named \USER\PETE . You


would follow these steps:

1. To ensure that the directory is empty, type the following:

DIR \USER\PETE
then press ENTER

2. Then, from any directory except the one you want to remove, type
the following command:

RMDIR \USER\PETE
then press ENTER

Remember that if you are working in the same directory that you are

MI-DOS USER GUIDE


MS.DOS COMMANDS

trying to remove, you 'll receive the following error message:

Invalid path, not directory , or directory


not empty .

SET

Purpose Sets one string of characters in the environment equal to


another string for later use in programs or batch files.

Category Internal

Syntax SET [key=va/ue]

Comments When MS-DOS recognizes a SET command, it inserts the


given string and its equivalent into a part of memory
reserved for the environment. If the string already exists in
the environment, it is replaced with the new setting.

If you specify just the first string , SET removes any previ-
ous setting of that string from the environment. Or if you
use the SET command without parameters, MS-DOS
displays the current environment settings.

Examples

Setting a String

The following command sets the string include to C:\INC until you
change it with another SET command: SET INCLUDE=C:\INC

7-71
SORT

Purpose A filter which sorts data alpha-numerically in forward or


reverse order.

Category External

Syntax [drive:][path] SORT (fR][+number]

Comments If you do not specify a file, SORT takes input typed in at


the keyboard and outputs to the screen.

The SORT program uses the collating sequence table,


based on the country code and code page settings.

The I and < redirection symbols direct data through the


sort utility from source. For example, you may use the 01 R
command or a filename as a source. You may use the
MORE command or a filename as a destination.

Option Switches

S WITC H PURPOSE

/R Reverses the s ort ; t ha t is, sorts from Z to


A , and th e n fro m 9 to o.

/+ number Sorts th e file ac c ording to the c ha rac ter in


column number . If you do n ot s p ec ify this
switch , the SORT command sorts t he fi le
starting with the character in t h e firs t
column.

Note: SORT does not distinguish between uppercase and lowercase


letters. Characters above ASCII code 127 are sorted based on
...·DO. CO .... AND.

information found in the COUNTRY.SYS file, or in an alternate file


specified by the country command in your CONFIG.SYS file.

Examples

Sorting a file

The following command reads the file EXPENSES.TXT, sorts it in


reverse order, and displays it on your screen:

SORT /R < EXPENSES. TXT


then press ENTER

The following command pipes the output of the DIR command to the
SORT filter. This filter sorts the directory listing starting with column 14
(the column in the directory listing that contains the file size) and sends
the output to the screen. The result is a directory, sorted by file size:

DIR +SORT /+14


then press ENTER

The following command does the same thing as the previous one,
except that the MORE filter gives you a chance to read the sorted
directory one screen at a time:

DIR tSORT /+14+MORE


then press ENTER

SUBST

Purpose Substitute a dummy drive specifier for a pathname.

Category External, Non-network

Syntax 1 To Substitute:

[drive:][path] SUBST dummy-drive: pathname

7·73
Syntax 2 To undo a substitution:

[drive:](path] SUBST dummy-drive: /D


Syntax 3 To display the current substitution:

[drive:](path] SUBST

Comments The SUBST command lets you associate a directory


path with a dummy-drive letter. This dummy-drive
letter then represents a virtual drive because you can
use the drive letter in commands as if it represented
an actual physical drive.

When MS-DOS finds a command that uses a virtual


drive, it replaces the drive letter with the path and
treats that new drive letter as though it belonged to a
physical drive.

Note: The following commands do not work on drives


used in the SUBST command (or the JOIN com-
mand):

CHKDSK FORMAT SYS


DISKCOPY LABEL
FDISK RECOVER

Example

Creating A Virtual Drive

The following command creates a virtual drive, drive Z:, for the
pathname B:\USER\BETTY\FORMS:

SUBST Z: B:\USER\BETTY\FORMS
then press ENTER

This example assumes that you have included the line, LASTDRIVE=Z,
in your CONFIG.SYS file.

M8oD08 USER GUIDE


••·DO. CO.MAND

Now, instead of typing the full path name, you can get to this directory
by simply typing the name of the virtual drive:

Z:
then press ENTER

TIME

Purpose Display or set the system time.

Category Internal

Syntax TIME [hours:minutes[:seconds[.hundredths]]]

Comments MS-DOS keeps track of time in a 24-hour format, and uses


the time information to update the directory whenever you
create or change a file.

Displaying the current time

The TIME command without options displays the current


time, and gives you an opportunity to change it:

Current time is hh:mm : ss . cc


Enter ne w time:

If you do not want to change the time shown simply press


the ENTER key. If you do want to change the time, type in
a new value in the 24-hour clock format. The following are
valid values:

hours = a thru 23
minutes = a thru 59
seconds = a thru 59
hundredths = a thru 99

Separate these elements (seconds and hundredths of


seconds are optional) with the separator defined in the
country-dependent information file. For the United States,
use a colon (:) .

7·75
You can also type the new time directly on the command
line.

If you do not type a valid time, MS-DOS displays the fol-


lowing message and then waits for you to type a valid time:

Invalid time
Enter new time:

Note

You can change the time command format by changing the country
command in the CONFIG.SYS file. For more information, see the
"MS-DOS Software Installation Guide".

The TIME command sets your computer's internal clock.

Examples

To reset the time of day on your computer's clock, you can type the
time command by itself and MS-DOS will prompt you for the correct
time. Or you can include the correct time when you type the command.
For example, if you want to set your computer's clock at 1:36 p.m., you
could type the following command:

TIME 13:36
then press ENTER

TREE

Purpose Displays all the directories and paths on the given drive. It
also has an option to list the files in each directory.

Category External

7-71 Ms-DOS USER GUIDE


.... DO. CO .... AND.

Syntax TREE [drive:] UF]

Comments Finding Directory Names The TREE command lists the


full path of each directory, along with the names of their
subdirectories.

The IF switch displays the names of the files in each direc-


tory.

Examples

If you want to see names of all directories and subdirectories on your


computer, simply type:

TREE
then press ENTER

If you also want to see, one screen at a time, the files in all the
directories on drive C:, you could type:

TREE C: IF I MORE
then press ENTER

Printing a Tree Listing: To print that same list on a printer, use the
following command:

TREE C: IF > PRN


then press ENTER

TYPE

Purpose Displays the contents of the specified text file on the video
screen.

Category Internal

7-77
Syntax TYPE [drive:)filename

Comments You can use the TYPE command to view a text file without
modifying it.

Note that when you use TYPE to display a file that con-
tains tabs, all the tabs are expanded to the current setting
for tabs (generally eight spaces wide). Also, if you try to
display a binary file or a file created by an application pro-
gram, you may see strange characters on the screen,
including bells, formfeeds, and escape sequence symbols.

Examples

Displaying A File

If you want to display the contents of a file called HOLlDAY.MAR, you


would type the following command:

TYPE HOLlDAY.MAR
then press ENTER

If the contents of the file you wish to display are fairly long, you could
use a command like this to display the file's contents one screen at a
time:

TYPE HOLlDAY.88I MORE


then press ENTER

VER

Purpose Displays the MS-DOS version number.

Category Internal

Syntax VER
".-DO. CO.... AND.

Comment If you want to know what version of MS-DOS you are


using, you simply type the VER command . The version
number will then be displayed on your screen.

Example

Displaying The MS-DOS Version

When you type:

VER
then press ENTER

the following message is displayed:

Oliv e tti Pe rso n al Co mp u ter DOS Ve rsion 3 . 30 Rev. x . xx

VERIFY

Purpose Sets an internal switch which causes disk writes to be


verified.

Category Internal

Syntax VERIFY [ONIOFF]

Comments You can use this command to verify that your files are writ-
ten correctly to the disk (no bad sectors, for example) .
MS-DOS verifies the data as it is written to a disk. You will
receive an error message only if MS-DOS is unable to suc-
cessfully write your data to a disk.

Note: This command has the same purpose as the IV


switch in the COPY command.

7-79
Examples

If you want to know the current setting of VERIFY, use the VERIFY
command without an option:

VERIFY
then press ENTER

VERIFY ON remains in effect until you type the following :

VERIFY OFF
then press ENTER

VOL

Purpose Displays the disk volume label identification, if it exists.

Category Internal

Syntax VOL [drive:]

Comments This command displays the volume label of the disk in a


specific drive. If you do not type a drive letter, MS-DOS
displays the volume label of the disk in the default drive.

Note: For more information about how MS-DOS uses


volume labels, see the LABEL and FORMAT commands in
this chapter.

Il&OO8 USER GUIDE


"S-DO. CO .... AND.

Examples

Displaying A Volume Label

If you want to find out what the volume label is for the disk in drive "A: ",
you would type the following:

VOLA:
then press ENTER

If the volume label is DOS 3-3, MS-DOS responds by displaying the


message:

Volum e in dri v e A is DOS 3 - 3

XCOpy

Purpose Copies files and directories, including lower level direc-


tories, if they exist.

Category External

Syntax [drive:][path] XCOPY source-pathname


[target-pathname] [f A][fD:date] [fE][fM][fP][fS][fV][fW]

Comments If you omit the target parameters, XCOPY assumes you


want to copy the files to the default directory,

If you only specify the drive : XCOPY uses the default


directory with the default filename, *,* ,

7-81
Option Switches

SWITCH PURPOSE

IA Copies source files that h ave their archive


bit set . Does not modify the archive b it of
the source file. For information on how to
set t he archive attri bu te , see the ATTRIB
command.

ID:date Copi es sou rce files modifi e d on or after the


specified date. Not e that the date format
may vary d e pending on the co unt ry code that
you are using . For mor e information, see the
DATE command.

IE Copies any subdir e ctories , e ven if they are


e mp ty. You must use this s wit ch with the Is
s wit c h.

1M Same as the IA s witc h , but aft e r copying a


fil e , it turns off the archiv e bit in the
source file. For information on how to set
the archive attribute , se e the ATTRIB
command .

Ip Prompts you wit h (Y IN?) , a.ll o wing you to


confirm wh ether you want to create each
target fil e .

Is Copies directories and lo wer level


s ubdirectories , unless they are empty. If
you omit this switch, XCOPY works within a
single dir ector y.
--------------------------------------------------------~~

Ms-DOS USER GUIDE


liS-DOS COIlIiANDS

SWITCH PURPOSE

Iv Causes XCOpy to v erify eac h file as it is


written to the target to make sure that the
target files are identica l to the source
files.

Iw Causes XCOpy to wa it before it starts copying


files.

XCOpy displays the following message:

Press any key when ready to


start copying files

You must press a key to continue, or press CONTROL-C to abort the


XCOPY command.

Examples

Using The XCOPY Command

The following example copies all the files and subdirectories (including
any empty subdirectories) on the disk in drive A: to the disk in drive B:

XCOPY A: B: IS IE
then press ENTER

The XCOPY command may prompt you to specify whether the target is
a file or a directory. For example, the following command creates the
directory A:\WORKERS as it doesn't already exist, and copies the file
payroll to it:

XCOPY PAYROLL A:\WORKERS


then press ENTER

7-83
XCOPY asks you :

Does TARGET specify a file na me


or dir ector y on the target
(P) file , D(dir ector y)?

Type F if the target is a file, or 0 if the target is a directory.

Another method to distinguish between the target being a file or a


directory is to place a back-slash (\).

By using the back-slash, it indicates that the target is a directory:

XCOPY PAYROLL A:\WORKERS\


then press ENTER

Using this method XCOPY does not ask whether the target is a file or a
directory.

Ms.D08 USER GUIDE


A. GLOSSARY OF TERMS
GLOSSARY OF TaR..S

The following table defines the terminology in this manual.

'PERM MEANING

active The partition on hard disk which


partition contain the operating system files
enabling the bootstrapping of the
computer. This happens on system
reset or when the computer is
turned on .

ASCII American Standard Code for


Infor ma tion Interchange. A 7 BIT
code, which has been extended to
an 8 BIT code (a BYTE ) to
represent g r aphic characters and
international c h aracters .

basic input Part of the operating system which


output system provides an interface with the
(BIOS) ma chi ne hardware. Most of the
BIOS is in Read Only Memory (R OM) ,
the rest is loaded from the syst e m
disk.

binary digit In a bin ary numbering system , only


(BIT) t wo ma rks ar e used 0 and 1. Each
of these marks is called a binary
digit.
------------------------------------------------------~~
TERM MEANIN G

bootable A file of a specific format that


file th e bootstrap loader can load into
memory to initialize the system.

byte Eight bits, which is normally a


code for an ASCII character.

curren t The directory in whi ch you are


directory wo rking .

cylinder Hard disks usually consist of a


numb er of platters. A cy linder
refers to the same track on each
surface of the platters which form
a notional cylinder.

disk A diskette or hard disk.

diskette A sing l e or double ' sided 5 1/4 or


3 1/2 in floppy disk.

drive A letter referring to lhe disk elte


specifier drive or hard disk drive in
question. For exa mple i t may be:

A - first diskette drive.

B - second diskette drive.

C hard disk drive.

editing 'rhe keys that invoke the intra -


function line commands.
keys
GLOSSARY OF TaR..S

TERM MEANING

exter nal A co mmand that is not loaded into


co mmand memory at initialization. Such
comma nd s resi de on d isk from wh ere
they are loaded, exec ut ed and
purged from memory.

for matting Disks must be formatted before


they can be us ed with MS-DOS.
Formatting places trac k s, wh ich
are s p lit into sectors, onto the
s urface(s) of a disk. The sectors
are of fixed numb er of by tes ,
typically 512 bytes. Also
formatting places a boot record
and an e mp ty directory on the
disk.

hard disk A disk tha t is built into the


com pute r . A hard disk can store
mu c h mor e information than a
floppy disk, and the co mputer can
retr ie v e in formati o n from it
faster .

hardware A system rei nitiali zation caused


reset by pre ssi ng the physical reset
button. Th e subsequent
initialization includes diagno stic
tests and a reset of all system
parameters. Any AUTO EXEC . BAT file
or CONFIG.SYS file is exec ut ed.

inter-line The EDLIN co mmands that operate o n


commands e ntire lines of text .
-------------------------------------------------------~
TERM MEANING

intra - line The co mmands invoked by the


commands special editing function keys that
perform editing operations within
a sing l e line of text.

internal A com mand that is embedded in the


command COMMAND. COM file and resides in
memory whenever MS - DOS is booted .

Kilobyte 2 to the power 10 ~ 1024 Bytes


KB

Mega - byte 2 to the power 20 1 048 576


MB Bytes

nil A parameter to a command where the


parameter parameter in question is not
specified in the command line.
The parameter therefore assumes a
default value.

partition A certain number of cy l inders of a


hard disk, which have been set
aside for the use of a particular
op e rating system. That operating
system treats the partition like a
complete, but smaller, hard disk .
The maximum primary partition size
a ll owed for MS - DOS is 32 MB. The
number of cylinders this
corresponds to, depends on how
many bytes per cylinder.

piJLhniJm e A sequence of one or more


directory names separated by
ba c kslashes optionally beginning
------------------------------------------------------~~

MS-DOS USER GUIDE


GLOSSARY OF TIER.S

TERM MEANING

with a drive specifier and


optionally terminating in a file
name. It specifies a path through
a directory structure to access a
file or directory.

sectors The track on a disk is divided


into sectors. MS - DOS disks are
soft sectored. The number of
sectors per track is typically 8 ,
9 or 15.

source line A line of text containing either


the last command line entered or
the current line in a file being
edited. It can be retrieved in
whole or part or modified using
the special editing function
keys.

system file An MS - DOS file that is present on


the MS·DOS system diskette that
contains system software. There
are three such files: 2 hidden
files and COMMAND. COM.

system reset A system reinitialization caused


by pressing the CTRL , ALT and DEL
keys simultaneously. Any
AUTOEXEC.BAT file or CONFIG.SYS
file is executed .

text file An ASCII file whose records are


separated by CR/LF.
----------------------------------------------------------~~
TERM MEANING

tracks per A disk track is the circular locus


inch oE the head as the disk rotates.
(t. p. i.) The head can be moved to t h e other
tracks; they are concentric
circles. A double density
diskette has 48 t . p . i . A quad
density disk has 96 t.p.i.

virtual disk An emulation of backing store in


Rando m Access Memory (RAM). It is
faster than disk backing store ,
but the information on virtual
disk is lost when the computer is
turned oEf.

volume label A name that can be assigned to a


disk by the POR MAT command. It
will subsequently be displayed in
a directory listing , or by t h e VOL
command

wild card A special symbol used to represent


character any single character (?) or any
string of characters (*).

working The lime between booting MS - DOS


session and the next boot of MS-DOS or
switch-of f .

M8-008 USER QUIDE


Code 01504801 U
Printed In Italy

You might also like