Olivetti - MS-DOS 3.30 - User Guide
Olivetti - MS-DOS 3.30 - User Guide
MS·DOS
User Guide
PERSONAL
COMPUTER
111111111
PUBLICATION ISSUED BY:
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.
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
RELATED PUBLICATIONS
DISTRIBUTION: General(G)
PART I
1. LEARNING ABOUT MS·DOS
DIRECTORIES 2-7
3. GETTING STARTED
v
QUITTING MS-DOS 3-3
4. USING COMMANDS
PART II
vi
CONTENTS
INTRODUCTION 6-1
EDIT 6-1
COMMANDS 6-11
GOTO 6-11
DELETE 6-12
FILE 6-12
7. MS-DOS COMMANDS
vII
NOTATION CONVENTIONS 7-9
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
VOL 7-80
XCOPY 7-81
A. GLOSSARY OF TERMS
x
1. LEARNING ABOUT MS·DOS
TERMS YOU SHOULD KNOW
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
File
......... \ / -
~- ,,~
\ / /'
[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:
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
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:").
Drive Name
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.
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.
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
Error Messages
Memory
THE KEYBOARD
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.
First, note that there are two important differences between a typewriter
keyboard and a computer keyboard:
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
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
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
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.
24
copied or changed a write-protected disk it's always a good idea to
replace the write-protect tab.
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
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.
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:
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
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:
Warning: Some applications may not let you use all of these symbols.
If in doubt use only letters and numbers.
Invalid Filenames
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.
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: \
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
STARTING MS-DOS
To start MS-DOS, just follow these steps (these steps work for
computers that have either hard disks or floppy disks):
2. Insert this disk into drive "A: ". (Refer to your computer's
"Installation and Operations Gu ide" to identify the correct drive.)
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) :
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
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
1\. )
In this example, the default drive is drive "A:", so the A> is the standard
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 .
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.
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:
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.
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
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 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.
The following example assumes that your hard disk is named drive
"C:". Follow these steps to format it:
FORMAT C: IV /S
then press the ENTER key
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.
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 )
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.
To copy your MS-DOS master disk onto a hard disk (drive C) , follow
these steps:
COPY A:*.* C:
This command tells MS-DOS to copy all fi les on drive "A:" to drive
lie:".
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.
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:
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.
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.
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
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:
2. Make sure the disk drive door (for drive A:) is closed
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
To fix this error, you simply close the door for drive "A:" and type R
(for Retry)
Directory of A:\
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.
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:
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 SALES.DOC B:
Again , by substituting the drive letter "C" for "8", you could copy the
SALES.DOC file to drive "C:".
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:
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.
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.
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:
/
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.
1. Make sure that the disk with the PAYROLL.DOC file is on the disk
in the default drive (nA:n).
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.
1. Make sure that the disk with the salary.doc file is in the default
drive (A) .
TYPE SALARY.DOC
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.
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
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:
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.
PRINT B:INVEST.MNT
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 .
This section presents two commands that you use for disks: FORMAT
and DISKCOPY.
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
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:
FORMAT B: IV
3. Press the ENTER key.
A)FORMAT B : Iv
Insert new diskette for drive B:
and strike ENTER when ready
5. Press the ENTER key to start the format process. When formatting
is complete, MS-DOS displays the following prompt:
6. Type a label that identifies the contents of this disk (for example,
DATA DISK), and press the ENTER key. MS-DOS then asks:
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.
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
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
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:
DISKCOPY A: B:
3. Press the ENTER key. Your screen should look like this:
A>DISKCOPY A: B:
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-13
5. USING APPLICATIONS WITH MS·DOS
USING APPLICATIONS WITH .. S.DOS
Once you have started MS-DOS, you can run an application program,
as follows:
2. Put the application program disk in drive "A:" (the default drive)
Example
1. Make sure that the default drive is drive "A:" by typing the letter "A"
followed by a colon.
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.
Example
1. Change the default drive to drive "C:" by typing the letter "C",
followed by a colon.
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.
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:
EDIT PENCIL.AD
then press the ENTER key
Since you are just creating the file, EDIT responds with the
following message:
OK to Create?
rile: pencil. ad
+---+---+---+---+---+---+---+---+---+---+---+---+---+---
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
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.
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)"
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.
EDIT
Category External
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.
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?
Use the function keys to exit and/or save the file you are editing.
Once the Video File Editor has been invoked the monitor shows a
display such as the one shown in Figure 6-1 .
.o
---------------------- BOTTOM --------------------------
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).
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.
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.
HOME TOP
END BOTTOM
- CURSOR LEFT
-
t
CURSOR RIGHT
CURSOR UP
~ CURSOR DOWN
FI COMMAND MODE
SHIFT FI ABORT
F2 RESTORE LINES
F3 JOIN LINES
\0'4 END OF LI NE
F5 SAVE
F7 GOTO MARK
F8 SEARCH DOWN
SHIFT F8 SEARCH UP
F9 LINE DOWN
SH IFT F9 LINE UP
KEY ~ STROKE FUNCTION KEY NAME
CTRL H BACKSPACE
CTRL I TAB
CTRL L REFRESH
<~ BACKSPACE
ESC ESCAPE
TAB
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
Examples
Search Down
2. Type "func".
The cursor will move under the "f" of "function in the above text.
Search Up
2. Type "Editor".
The cursor will move under the "E" of "Editor" in the last line of the
above text.
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
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
8-12
TN. VIDEO FILE EDITOR ,EDIT,
1-13
7. MS·DOS COMMANDS
MS-DOS COMMANDS
• Internal commands
• External commands
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:
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:
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
DIR pathname
DIR D:\USER\PETE
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.
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.
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.
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.
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".
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.
DIR
The DIR command can send this output to a file named CONTENTS if
you enter the following:
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.
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:
MS-DOS filters include: FIND, MORE, and SORT. Their functions are
as follows:
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
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).
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:
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:
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:
7·7
COMMAND CATEGORIES
Non-network
This category means that the indicated command does not work over
OLiNET LAN . The following commands are "Non-network":
NOTATION CONVENTIONS
Example
Note that uppercase letters and words are used simply as visual
aids in this manual. Keywords may be typed in lowercase if
desired.
Example
DISKCOPY A: B:
• 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
ellipsis
Example
The representation:
[filespec]
Example
The representation:
{AlBIC}
Example
The representation:
[AlBIC)
Example
The representation:
AlB) ...
B
more than once in succession .
• 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.
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
[drive:)[path)APPEND[=)[drive:)path[;[drive:]path) ...
Syntax 2 The first time APPEND is called, if you wish to extend the
way APPEND works:
APPEND[=][drive:]path[;[drive:]path) ...
APPEND
APPEND[=];
Examples
APPEND B:\LETTERS;A:\REPORTS
1. APPEND IX
2. APPEND=G:\PROGRAMS;D:\TEXT
3. PHRASE MEMOIRS
Warning
Do not use the MS-DOS 3.30 APPEND command with the OLiNET
LAN APPEND command.
7·13
ASSIGN
Category External
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.
ASSIGN A=C
SUBST A: C:\
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:
All references to drives "A: " and "8:" would then go to drive "C:".
ASSIGN
ATTRIB
Category External
Where
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.
Examples
ATTRIB NEWS86
then press ENTER
ATTRIB +R REPORT.TXT
then press ENTER
ATTRIB -R B:\USR\PETE IS
then press ENTER
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
Category External
Option Switches
S WITCH PURPOSE
/S Backs up subdirectories.
7-11
Backup Log Files A Backup Log File uses the following format:
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.
Example
Backing Up Files:
BREAK
Category Internal
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.
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
BREAK
then press ENTER
CHOIR
Category Internal
Syntax 2 CD [drive:][path]
Examples
CHOIR \PRIMETIM
then press ENTER
or
CO \PRIMETIM
then press ENTER
CO
then press ENTER
CHOIR B:
then press ENTER
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
CD SPONSORS
then press ENTER
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.
Where
CLS
Category Internal
Syntax CLS
Comments The CLS command clears your screen, leaving only the
MS-DOS prompt and a cursor.
7-25
Examples
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
Category External
Option Switches
SWITCH PURPOSE
7-27
Examples
Type:
COMMAND IC CHKDSK B:
then press ENTER
COMP
--
- --
----
Category External
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:
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:
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:
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.
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:
COpy
Category Internal
or
Option Switches
S WITCH PURPOSE
741
also causes the copy command to run more slowly, because MS-DOS
must check each entry recorded on the disk.
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.
Examples
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:
Combining files: You can also combine several files into one by using
wildcards; for example:
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:
The following copy command combines all files matching *.TXT and all
files matching *.REF, into one file named 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:
COPY ALL.TXT+*.TXT
CTTY
Purpose Lets you change the device from which you issue com-
mands.
Category Internal
Where device specifies the device from which you are giving com-
mands to MS-DOS.
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.
Examples
CTTY AUX
then press ENTER
CTTY CON
then press ENTER
DATE
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.
7-35
allowed numbers are:
mm 1 thru 12
dd 1 thru 31
yy 80 thru 99 or 1980 thru 2079
Examples
If you simply type the DATE command, MS-DOS displays the following
message:
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.
DEL
Category Internal
or
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:
Warning
Once you have deleted a file from your disk, you cannot recover it.
7-37
Examples
Deleting a file
DEL VACATION
then press ENTER
DEL VACATION.*
then press ENTER
DIR
Category Internal
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.
Option Switches
SWIT CH PURPOSE
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:
If your directory contains more files than you can see on the screen at
one time, enter the following:
DIR /P
DISKCOMP
Option Switches
SWITCH PURPOSE
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:
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:
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
DISKCOPY
Option Switch The /1 switch allows you to copy only one side of a
disk.
7-43
copy on the drives that you originally specified .
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
EXIT
Classification Internal
Syntax EXIT
Examples
COMMAND
then press ENTER
EXIT
then press ENTER
FC
Purpose Compares two files or two sets of files and displays the
differences between them.
Category External
[drive:][path] FC U#]Ua]Uc]UIJUnJUtJUw]
Ulb length]pathname1 pathname2
Example
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:
FIND
Category External
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.
Option Switches
S WI'T'CH PURPOSE
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
FORMAT
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.
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.
Option Switches
SWITCH PURPOSE
7-41
SWI TCH PURPOSE
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
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
FORMAT A:
then press ENTER
7-51
GWBASIC
Category External
JOIN
Syntax 1 To join:
[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
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
JOIN D: C:\SALES\REGIONAL
LABEL
Examples
LABEL A:SALES1987
then press ENTER
MKDIR
Category Internal
Syntax 2 MD [drive:][path]
Examples
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
Category External
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.
Notes
Examples
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 :
PATH
Category Internal
Characteristics
PATH tells MS-DOS which directories, and in what order, to look for
external commands after it has searched your current directory.
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
PATH=D:\USER\PETE;D:\USER\EMILY;C:\BIN
Purpose Queues test files for background printing, while other MS-
DOS commands are obeyed.
Category External
Syntax 1
Syntax 2
Syntax 3
Where
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
When you run PRINT for the first time in a terminal session, you are
prompted as follows:
Type the name of a valid line printer device driver, or simply press
ENTER to accept the default line printer device PRN:.
S WI T CH MEANING
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
Category Internal
Special Prompts
You can use the characters in the prompt command to create special
prompts:
$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
Examples
PROMPT $P
then press ENTER
RENAME
Category Internal
Examples
Renaming files
In the next example, REN renames a file named CHAP10 (on drive B:)
to PART10:
REPLACE
Category External
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
If you specify IW but not lA, REPLACE displays the following message:
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:
Adding Files
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
Option Switches
SWITCH PURPOSE
SWITCH PURPOSE
Once MS-DOS has restored the file, use the DIR command to make
sure that the file was restored properly.
Note
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
Category Internal
Syntax 2 RD [drive:]path
Examples
Removing a Directory
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
SET
Category Internal
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
Category External
Option Switches
S WITC H PURPOSE
Examples
Sorting a file
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:
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:
SUBST
Syntax 1 To Substitute:
7·73
Syntax 2 To undo a substitution:
[drive:](path] SUBST
Example
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.
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
Category Internal
hours = a thru 23
minutes = a thru 59
seconds = a thru 59
hundredths = a thru 99
7·75
You can also type the new time directly on the command
line.
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".
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
Examples
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:
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
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:
VER
Category Internal
Syntax VER
".-DO. CO.... AND.
Example
VER
then press ENTER
VERIFY
Category Internal
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.
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 OFF
then press ENTER
VOL
Category Internal
Examples
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
XCOpy
Category External
7-81
Option Switches
SWITCH PURPOSE
SWITCH PURPOSE
Examples
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:
7-83
XCOPY asks you :
Using this method XCOPY does not ask whether the target is a file or a
directory.
'PERM MEANING
TERM MEANING
TERM MEANING