BP232 A Concise Introduction To MS DOS
BP232 A Concise Introduction To MS DOS
Introductio
to MS-DOS
by
Noel Kantaris
Although every care has been taken with the production of this
book to ensure that any projects, designs, modifications anchor
programs etc. contained herewith, operate in a correct and safe
manner and also that any components specified are normally
available in Great Britain, the Publishers and Author do not accept
responsibility in any way for the failure, including fault in design,
of any project, design, modification or program to work correctly
or to cause damage to any other equipment that it may be
connected to or used in conjunction with, or in respect of any
other damage or injury that may be so caused, nor do the
Publishers accept responsibility in any way for the failure to
obtain specified components.
Notice is also given that if equipment that is still under warranty
is modified in any way or used or connected with home -built
equipment then that warranty may be void.
IBM, PC, XT, AT, PS/2, PC -DOS and OS/2 are registered
trademarks of International Business Machines corporation
Structure of MS-DOS 3
Booting up the System 5
GLOSSARY OF TERMS 63
INDEX 65
INTRODUCTION
Most 16 -bit microcomputers use Microsoft's Disc
Operating System (MS-DOS) as tele prime means of
interaction between user and computer. Owners of IBM
PCs know this operating system as PC -DOS or DOS, which
is IBM's implementation of MS-DOS. The name MS-DOS
will be used throughout this book to distinguish this
operating system from another popular one, namely
Digital Research's Concurrent DOS (or C -DOS).
Since its inception in 1981, PC/MS-DOS has been the
standard operating system for personal computers and by
now is being used by more than 12 million people. As the
number of users increased over the years, so too has the
complexity of applications run on their PCs. To meet these
ever increasing demands, PC/MS-DOS has also increased
its functionality several times in the form of new versions,
as shown in the table below.
Version Date Main changes in functionality
3
Booting up the System:
To start up the computer, usually referred to as booting up
the system, the MS-DOS disc which contains the System
files (known as the System disc), must be in the A: drive for
a floppy disc -based system, or the files must have been
transferred on the C: drive for a hard disc -based system. It
is assumed here that you have followed the
manufacturer's instructions on how to format the hard disc
and transfer the System and all other files from the System
and Utility discs onto it. If this is not the case, then do so
before going on any further.
In short, when you receive your new computer, you need
to run a utility called FDISK (which stands for Fixed Disc)
which allows preparation of the hard disc to run DOS or
any other operating system. The utility allows you to
partition the hard disc in such a way as to allow more than
one operating system to reside on it. Normally, you'll be
using the hard disc to run MS-DOS only, on one partition.
Be very careful with this utility, because proceeding any
further with it will format your hard disc automatically,
without any warning, with consequent loss of all data that
might reside on it. Nonetheless, on formatting the hard
disc, the utility transfers onto it the two hidden system files
and copies the COMMAND.COM file onto it, but does not
copy the rest of the MS-DOS operating system files. To
achieve this, and assuming that the MS-DOS system disc is
still in the A: drive, type
A>COPY A:*.* C:
repeating the command with the second (utility) disc, if
there is one, inserted in the A: drive. However, before you
start using the FDISK utility, make sure that your computer
dealer has not actually done all this for you, is which case
FDISK is best left alone. Also, before using this utility, make
absolutely sure that you have read and complied with your
manufacturer's instructions on the subject.
If, after successfully booting up the system (indicated by
the appearance of a prompt A> or C>, for booting from a
floppy or hard disc, respectively), you were to type DIR
(followed by 'Return') to find the contents of the disc,
neither of the first two System files (MSDOS.SYS and
10.SYS) would appear on the DIRectory as they are hidden
so that you can not delete them. Only tie third file
(COMMAND.COM) would be displayed.
4
In addition to these three special files, there are a number
of other files supplied by MS-DOS which perform various
important tasks. These files are collectively known as the
MS-DOS utilities and will be examined in detail later. To be
able to distinguish between disc drives, MS-DOS refers to
them by a letter followed by a colon, e.g. A: or C: for the
prime drive of the appropriate system. In a twin disc -based
system, there are two drives; A: and B:, with drive A: being
the leftmost or uppermost of the two, while on a hard disc -
based system there is a floppy disc drive, A: and a hard
disc drive, C:. Users on networked systems can access a
network hard disc by assigning it as another drive on their
micro, namely as E: or Z:
On booting up the micro from a PC/MS-DOS System
disc, the following tasks are performed:
(a) A self test on its Random Access Memory (RAM) is
performed
(b) A check is made to see if a floppy disc is in drive A:,
and if there is, whether it is a System disc. If it is, it
boots the system from the A: drive
(c) If no floppy exists in drive A:, an attempt is made to
boot the system from drive C:, if there is one,
otherwise in the case of the IBM, it goes into Read
Only Memory (ROM) based BASIC
(d) Configures the system by executing the CONFIG.SYS
file
(e) Reads the BIOS and the MS-DOS operating system
(f) Loads into RAM the COMMAND.COM file so that
internal commands can be made available instantly
(g) Executes the commands within the AUTOEXEC.BAT
file, if one exists, otherwise it asks for the Date and
Time which can be reset at this point. Pressing the
Return key, confirms what is displayed.
Should you receive any error message while these tasks
are being performed, you could restart the process, after
rectifying the error, by pressing simultaneously the three
keys marked Ctrl, Alt and Del. This will reboot the system.
5
MS-DOS has over twenty internal commands built into it
which are instarrly available as they reside in memory.
These are:
Command Meaning Command Meaning
BREAK Set Ctrl Ereak on/off CD Change directory
CLS Clear Screen COPY Copy tile(s)
CTTY Change I/O device DATE Display/set date
DEL Delete file(s) DIR Display directory
ECHO Set Echo on/off EXIT Exit Command level
MD Make directory PATH Search alternative
PROMPT Change prompt directories
REN Rename 'ile(s) RD Remove directory
SET Change parameters TIME Display/set time
TYPE Display a file VER Display DOS version
VERIFY Check disc writing VOL Display disc volume
6
FILES & THE DISC DIRECTORY
To see what files are held on the System disc, you must
access the disc directory by typing DIR at the A> prompt,
as follows:
A> DIR (and press the Return key)
The A> prompt will be displayed on booting up the system
if you are using a floppy disc -based system, otherwise the
prompt will be C>. Amongst the many files to be listed will
be the following:
Filename Extension Size Date Tme
APPEND COM 1725 18-05-87 12:00
COMMAND COM 24844 10-07-87 12:00
MORE COM 2377 18-05-87 12:00
ATTR I B EXE 8776 18-05-87 12:00
BACKUP EXE 23230 18-05-87 12:00
CHKDSK EXE 10272 18-05-87 12:00
DISKCOPY EXE 4992 18-05-87
EDLIN EXE 8018 18-05-87
FORMAT EXE 14567 18-05-87
LABEL EXE 3646 18-05-87
PRINT EXE 11840 18-05-87
RESTORE EXE 21632
SORT EXE 2794
SYS EXE 5232
ANSI SYS 1902
CONFIG SYS 77
VDISK SYS 6221
7
The extensions .COM, .SYS and .EXE are the most
common extensions of the files which make up MS-DOS.
They contain instructions which are executed directly by
the computer. Other extensions commonly used by
programs or users are:
.BAK .BAS .BAT .DAT .DOC .TXT .TMP
8
A> DIR *.EXE
which does not tell you very much, except that ME -DOS
does not understand you!
The wildcard character "*" can also be used as part of
the filename. For example,
A> DIR BAS*.*
will list all the files with all extensions on the logged drive
(in this case drive A:), starting with the three characters
BAS, irrespective of the ending of the filenames. The full
MS-DOS command should also specify which drive you
want to access, but can be omitted if the command -efers
to the currently logged drive. Thus,
A> DIR BAS*.* or
A> DIR A:BAS*.* will access the specified files on drive
A:, while
A> DIR B:BAS*.* will access the specified files on drive
B:.
will list all files with the extension .DOC, from TEXT1 to
TEXT99, but exclude those within the range TEXT100 to
TEXT999.
To list all the files from TEXT1 to TEXT999 you must use
the wildcard character "*" in place of the single query, as
follows:
A> DIR TEXT*.DOC
Finally, typing
A> DIR *.*
10
MANAGING DISC FILES
MS-DOS provides several commanas which help you to
manage your disc files efficiently. Some of these
commands are internal and some are external. If the
commands under discussion are external commands, it
will be pointed out so you can insert the System disc n the
logged drive which is the drive indicated by letter on the
screen prompt.
The DATE Command:
Typing the command
A> DATE
Root
Directory
19
The root directory is shown here with five sub -directories
under it, while two of these have their own sub -directories
below them. For maximum efficiency, the root directory
should contain only the System and start up files, together
with information on its sub -directories, a kind of an index
drawer to an office filing system.
Files in different sub -directories can have the same name
because MS-DOS can be told which is which via a system of
PATH names. For example, a file in the SSFILES sub -
directory could have the same name, say SALARY87.TMP, as
one in the GRFILES sub -directory. Nevertheless, we can
instruct MS-DOS to fetch the file in the SSFILES sub -directory
by giving its path name which is:
\SPREADSH SSFILES\SALARY87.IMP
whereas that of the file in the GRFILES sub -directory is:
\SPREADSH\GRFILES\SALARY87.TMP
In the example shown previously, the contents of the
various sub -directories might be as follows:
The root directory which contains the two
hidden System files MSDOS.SYS and 10.SYS,
the Command Processor COMMAND.COM,
the CONFIG.SYS file, the AUTOEXEC.BAT file,
the names of all its sub -directories (five in our
example), and a number of batch files
(corresponding to the sub -directories) which
allow direct access to the sub -directories from
the root directory.
BASIC A sub -directory containing all the BASIC
programs which came on your System disc
and the MS-DOS examples disc. These are
files which either contain the letters BAS, for
example BASICA or GWBASIC, or have a .BAS
extension.
DATABASE A sub -directory containing a database with
built-in word processor. Below this, there are
two sub -directories; one for the database files
(DBfiles), and one for the word processor files
(WPfiles). The actual files in these two
different sub -directories will most certainly
have different extensions; perhaps .DBS for
the DBfiles and .DOC for the WPfiles, but the
exact extension will be dictated by the actual
software package.
20
DOS A sub -directory containing all the MS-DOS
files comprising the external MS-DOS
commands.
COMMS A sub -directory containing communications
programs, propriety backup software, etc.
SPREADSH A sub -directory containing an integrated
spread sheet and graphics package. Below
this, there are two sub -directories, one for the
spread sheet files (SSfiles), and one for the
graphics files (GRfiles). Again, the actual files
in these two sub -directories will have different
extensions which more than likely w II be
dictated by the software package.
MS-DOS provides three special commands for the creation
and management of sub -directories. these are:
Command Meaning Example
MD Make sub -directory C> MD \BASIC
CD Change directory C> CD \BASIC
RD Remove directory C> RD \BASIC
These will be explained in detail shortly, but before we go
any further, it will be extremely useful and prudent to have
a prompt which indicates in which directory we are at any
given time. We can do this by changing the prompt from
always being C>, to indicate the PATH. To achieve this,
type
C> PROMPT $P$G
21
Managing directories:
Before a directory can be used, it must exist. f it does not,
you can make it with the MD command.
To make the sub -directory called BASIC, so that you
could transfer to it all BASIC programs and files from your
MS-DOS System and examples discs, type the following
line
C: \> MD \BASIC
C:\>_
which makes the BASIC sub -directory of the root directory
and waits for further commands. Note that the full path
was given after the MD command, by specifying first the
root directory with the use of the back -slash (\) and then the
sub -directory by its name.
To transfer files from a disc in the A: drive, first change
directory using the CD command by typing
C:\> CD ,BASIC
C:,BASIC>_
which causes the prompt to change, indicating that
MS-DOS has actually changed directory. Without the
prompt change, you would have had the typical "where
am I?" problem. Note that the moment we create a
sub -directory we tend to refer to its parent as directory,
even though itself might be a sub -directory to another
parent directory.
To copy all BASIC programs and files to this directory,
place in turn each MS-DOS disc in the A: drive and type
C:\BASIC> COPY A:BAS*.*
C:\BASIC> COPY A:*BAS*.*
C:\BASIC> COPY A:*.BAS
C:\BASIC>_
Alternatively, we could have issued these commands from
the root directory without first changing directories. As an
example, the first line of the three copy commands given
above, would have to be typed as
C:\> COPY A:BAS*.* C:,BASIC
which, however, involves more typing on your part.
22
Should you be dissatisfied with the name of a directory,
you will have to make another directory giving it your
preferred name, copy to it all files from the unwanted
directory, delete all files from the unwanted directory, and
then remove the unwanted directory from its parent
directory. This procedure is essential because:
(a) you can not rename directories, and
(b) you can not remove directories unless they are empty.
As an example of the above procedure, let as assume that
we have created, as discussed previously, a sub -directory
to the root directory, called DATABASE. To have created
such a sub -directory, we would have had to return to the
root directory from whichever sub -directory we were at the
time, by typing
CDC
at the prompt.
We now proceed to create a sub -directory to the
DATABASE directory, called DOCBASE.
To create sub -directory DOCBASE, first change directory
from the root directory to that of DATABASE, as follows:
C:'\> CD DATABASE
C:\DATABASE>_
23
Let us now assume that for some reason the directory
name DOCBASE offends you and you would like to change
it to WPBASE instead. To do this you will hEve to type in
the following commands, assuming you are at the root
directory.
C:\> CD \DATABASE
C: \DATABASE> MD WPBASE
C: \DATABASE> CD \DATABP.SE\WPBASE
C:\DATABASE\WPBASE> COPY \DATABASE,DOCBASE,*.*
C:\DATABASE\WPBASE> CD ,DATABASE,DOCBASE
C: ,DATABASE\DOCBASE> DEL *.*
Are you sure? (Y/N)Y
C: DATABASE\DOCBASE> CD DATABASE
C:,DATABASE> RD DOCBASE
C: DATABASE>_
In order of appearance, these lines of commands do the
following:
(a) change directory to DATABASE
(b) make a sub -directory called WPBASE
(c) change directory to WPBASE
(d) copy from sub -directory DOCBASE all files to the
logged sub -directory
(e) change directory to DOCBASE
(f) delete all files from logged directory
(g) MS-DOS asks for confirmation
(h) change directory to DATABASE
(i) remove sub -directory DOCBASE.
As you can see, the procedure is cumberscme, so think
how you want to structure your hard disc before plunging
into it blindly.
Re -structuring directories and sub -directories, moving
files from one sub -directory to another, or making backups
of groups of files, can be made easy if you use certain
propriety software. Such utilities can save you hours of
effort and frustration and are well worth the very small
initial outlay.
24
THE EDLIN LINE EDITOR
MS-DOS provides you with a simple line editor, called
EDLIN, and you should become familiar with its use. In
general, edlin allows the creation and editing of ASCII files.
These are text files which when sent to the screen or
printer are interpreted as text, unlike the .COM files which
are binary.
Edlin can also be used to create the source code of
various programming languages, such as Fortran and C. In
such cases, remember to give the file the appropriate
extension. For the two languages mentioned above, -.hese
will be .for and .c, respectively.
To invoke edlin, the MS-DOS System disc or a disc that
contains it must be in one drive, and the file you went to
create or edit must be specified. Thus, typing the
command:
C: > edlin test.txt
expects to find edlin on the disc in the logged drive and the
file test.txt on the disc in the A: drive.
If the file does not exist on the specified disc, then edlin
responds with
New File
if that file does not exist on your disc. If it does exist and
you do not want to spoil its contents, then type q (for quit)
and press the Return key.
causes edlin to first find the string 'ir' in the word 'first' of
line 1:, then by typing s again, it forces edlin to find the
same string 'ir' in the word 'third' of line 3:.
The Search and Replace Command:
This command is similar to the search command, except
that it requires a replacement string. Thus, typing
*1,4r edited "Z re-edited
29
Exiting edlin:
To end the current session and exit edlin at any point, type
*e
which saves a new file under the chosen filename.
However, if the filename already existed on disc prior to
using edlin, ending edlin has the following effect: First the
name of the old file on the disc is given the extension .bak,
then the new file you have created by editing the old one is
saved with the original extension. In this way you can
make mistakes w.thout disastrous effects since the system
makes a backup 'He of the original. If need be, you could
DELete the .txt file and then REName the backup file (.bak)
to its original name and extension.
Note that edlin is disciplined not to allow editing of
backup files so, should you want to start using edlin to edit
the contents of a .bak file, you must first rename it, by
giving it a different extension, before proceeding.
If, on the other hand, you realised that too many
mistakes were made during editing, you could use the q
command to quit. as follows:
*q
1: FILES=8
2:*BUFFERS=2
*
31
To end the insert mode, press Ctrl -C on the 5: line and then
exit edlin by typing e. This will save your changed file as
CONFIG.SYS and the contents of the old file as CONFIG.BAK.
Do refer below for the meaning of each and every statement
you have been asked to change or add in your CONFIG.SYS
file.
Following is a list of the commands that you can include
within the CONFIG.SYS file which MS-DOS supports.
However, do remember that any changes made to this file
only take effect after re -booting which can be achieved by
pressing the three keys marked Ctrl, Alt and Del
simultaneously. A brief explanation of the commands is also
given.
BREAK By including the command BREAK=ON in the
CONFIG.SYS file, you can use the key
combination Ctrl -C (hold the key marked Ctrl
down and press C) or Ctrl -Break, to interrupt
MS-DOS I/O functions.
BUFFERS MS-DOS allocates memory space in RAM,
called buffers, to store whole sectors of data
being read from disc. The default number of
buffers is 2, each of 512 bytes of RAM. If more
data are required, MS-DOS first searches the
buffers before searching the disc, which
speeds up operations. The number of buffers
can be changed by using:
BUFFERS=n
where n can be a number from 1 to 99.
However, as each buffer requiresan additional
0.5 Kbyte of RAM, the number ycu should use
is dependent on the amount of available
memory. Best results are obtained by
choosing between 10-30 buffers, the exact
number being dependent on the size of the
application package being used in relation to
the size of your micro's RAM.
COUNTRY MS-DOS displays dates according to the US
format which is month/day/year. To change
this to day/month/year, use the command
COUNTRY=044
where 044 is for U.K. users.
32
Non U.K. users can substitute their
international telephone country code for the
044. The default value is 001, for the USA.
Users of a hard disc with PC -DOS 3.3 should
enter this statement as
COUNTRY=044,437,C: \DOS COUNTRY.SYS
where 437 is the code page of pre -3.3 versions
of DOS and COUNTRY.SYS is to be found in
the \DOS sub -directory. In PC -DOS 3.:3 the
extended IBM character set has been changed
to accommodate several versions of it by
offering several choices on the characters
displayed or printed. If you are a newcomer to
DOS then use the multilingual code page 850
in which many of the scientific symbols and
box graphic characters have been replaced by
international characters. This allows more
Europian languages to be supported.
However, using any other than code page 437
might cause problems with some application
programs as not all would have adapted to the
new codes. For more details regarding the
new code page numbers and the requirrnent
of using the DEVICE= statement it the
CONFIG.SYS file when the new codes are
being used, see your DOS reference guide. No
additional DEVICE= statements are required
with code page 437.
CODEPAGE This command is to be found in PC/MS-DOS
versions 3.3 and later. The table that DOS uses
to define a character set is called a code page.
Thus include the command
CODEPAGE=437
where 437 is the code page definition of
pre -3.3 versions of DOS.
DEVICE MS-DOS includes its own standard device
drivers which allow communication with your
keyboard, screen and discs. However, these
drivers can be extended to allow other devices
to be connected by specifying them in the
CONFIG.SYS file. Example of these are:
33
DEVICE=ANSI.SYS
34
LASTDRIVE This command is used if additional drives are
to be connected to your system, or you are
sharing a hard disc on a network. The
command takes the form:
LASTDRIVE=x
where x is a letter from A to Z (default E).
SHELL Manufacturers of some micros provide a
"front end" or an alternative Command
Processor to COMMAND.COM as real -mode
command -line processor. To invoke this, the
command SHELL must be included within the
CONFIG.SYS file. The command takes the
form:
SHELL=FRONTEND.COM
where FRONTEND is the name of the
alternative Command Processor. The default
value of SHELL is COMMAND.COM.
at which point you enter the insert mode, type the :-,ommand
and save the created file, as follows:
35
*i 1
1:*KEYBUK
2:* "C
*e
C:
Users of a hard disc with PC -DOS 3.3 should enter the
KEYBUK statement as
1:*KEYBUK 437 C:\DOS KEYBOARD.SYS
where 437 is the code page of pre -3.3 versions of DOS and
KEYBOARD.SYS is to be found in the \DOS sub -directory. As
mentioned previously under the COUNTRY section, in
PC -DOS 3.3 the extended IBM character set has been
changed slightly to accommodate several versions of it by
offering several choices on the characters displayed or
printed. Each such version is referred to by a specific code
page number which defines the character set to be used. If
you intend to use any other code page than 437, then you
should refer to your DOS reference guide.
There are a lot of other commands that can oe included in
the AUTOEXEC.BAT file, such as setting the PATH, changing
directory or executing a program. Such commands will be
discussed in detail in the next section. However, in the mean
time remember to re -boot the system in order to activate the
AUTOEXEC.BAT file after you have created it.
Simple Batch Files:
Naturally, we would like to be able to use the MS-DOS
external commands from anywhere within the directory tree
without having to specify where the commands are kept (in
this instance, we have transferred them into the DOS
directory). The same could be said for the programs kept in
the COMMS directory. This can be achieved by the use of the
PATH command, as follows:
PATH C:\;C:\DOS;C:\COMMS
which should be included in the AUTOEXEC.BAT file. Note
the repeated reference to the C: drive which a lows the path
to be correctly set even if the user logs onto a drive other
than C:.
By now you must have noticed that every time you boot up
the system, the commands within your AUTOEXEC.BAT file
are echoed (displayed) onto the screen. To clean up the
screen of such echoes, change your AUTOEXEC.BAT file to
include:
36
ECHO OFF
CLS
PATH C:\;C:\DOS;C: COMMS
KEYBUK
PROMPT $P$G
ECHO HELLO ... This is your
VER
:end
at the prompt.
The VOL Command:
To find out the volume label of the disc in the logged drive,
type
C:\> VOL
42
The MORE filter Command:
This external filter command allows you to view text files a
page (23 lines) at a time - you are prompted to press a key
to display the next page. As such, it can be combined with
other commands to control scrolling of long ASCII files. For
example,
C:\> TYPE EXAMPLE.TXT MORE
can help you with viewing long text files if you are not used
to or quick enough to use the Ctrl S key sequence to halt
scrolling, after issuing the TYPE command.
43
The PRINT command provides background printing, that
is, it can print long files while you are doing something else
with your computer. In fact, using this command provides
you with a print spooler which allows you to make and
control a queue of several files for printing. The command
takes the form:
C:\> PRINT fi lespec adds filespec to print queue
C:\> PRINT f i lespec /C cancels printing that file
C:\> PRINT /T terminates all printing
C:\> PRINT displays files in queue
The PRINT command assumes that you have continuous
paper in your printer. There is no facility to pause printing.
To print the two text files TEXT1.DOC and TEXT2.DOC,
type
C:\> PRINT TEXT1.DOC
C:> PRINT TEXT2.DOC
Wildcard characters can also be used in the command, as
follows:
C:'\> PRINT TEXT*.DOC
which will spool all the files starting with the characters
TEXT and having the extension .DOC to the printer.
The PRTSC Command:
Text which is displayed on the screen can be sent to the
printer by pressing the Print Screen (Shift-PrtSc) key.
On the other hand, pressing the Ctrl and Print -Screen
keys simultaneously causes re -direction of output to the
printer. To cancel the effect, repeat the same key stroke.
The BACKUP and RESTORE Commands:
The external BUCKUP command allows you to archive files
from the hard disc. Since your disc contains valuable work,
you must make additional copies of all your important
files. The BACKUP utility allows you to generate those
backup copies on floppy discs. If you have a hard disc, you
should use this utility often; daily if necessary. The
command takes the form:
BACKUP source destination options
where source is the drive/path/files to be backed up,
destination is the drive to backup to, and
options are:
44
/A to add the files to a disc in the destination drive
/D: date to backup only files from the specified
date onwards
/M to backup only files modified since they were
last backed up
/S to also backup sub -directories of the source
path.
Thus, to backup, for the first time, all the wore processor
files whose path is \DATABASE\WPFILES, we type
C: > BACKUP C:\DATABASE,WPFILES*.* A:
restores selected files from the floppy disc in the A:: drive
to the sub -directory WPFILES in the C: drive.
45
***
MS-DOS has many more commands which can be used to
control a micro in special ways. However, this is an area
which lies outside the scope of this book. What was
covered here, together with the summary of the DOS
commands given in the last -but -one section of this book, is
more than enough to allow effective control of a
microcomputer.
***
46
DOS VERSION 4.0
DOS version 4.0 ends the limit of 32MB partition on hard
discs by employing a 32 -bit File Allocation Table (FAT),
instead of the previous 16 -bit employed in earlier versions,
with the limit of single partitions now being stretched to 4GB.
If one of these partitions is less than or equal to 32MB, then it
would be possible to boot up the system from that drive with
DOS v3.x, otherwise not. The SHARE program is
automatically installed if a hard drive with greater than 32MB
is set, so programs that will not work with SHARE installed
will not run under DOS v4.0 on a large hard disc.
It also supports the expanded memory specification
(EMS), as developed by Lotus, Intel and Microsoft, which
breaks the 640kB barrier by exploiting the expanded memory
boards to store data associated with the BACKUP,
FASTOPEN and VDISK commands. These are made possible
with the use of two expanded memory drivers -
XMA2EMS.SYS and XMAEM.SYS. The first is for use with
systems based on the 8086, 8088 and 80286 processors,
while the second is for use with the 80386 processor.
Other improvements include extra video mode settings to
support displays of greater than 25 lines, as provided by
enhanced (EGA) and video (VGA) cards, and graphic screen
printing for EGA and VGA graphics adaptors. The GRAPHICS
program now allows the 'PrtSc' key to perform a graphics
dump from EGA and VGA screens to a variety of IBM
printers. The commands required to perform these can be
modified for other non -IBM printers. You specify your printer
during installation, but make sure that the printer is switched
on before booting up the system with DOS v4.0, otherwise
you'll be told by the installation program that the printer of
your choice is not supported!
Further additions or modifications to DOS commards are
described in the section 'Command Summary' with v4.0
commands being marked with a superscripted asterisk (*).
Perhaps it is worth mentioning that the resident parts of v4.0
require an additional 15kB of memory above and beyond the
requirement of v3.3, with an additional 300kB of memory for
loading the DOS shell which however is overwritten when
programs are loaded. The use of the DOS shell, which is
optional, will be discussed shortly. Finally, error messages
have been enhanced so as to at least give an indication as to
what might be wrong - a vast improvement on previous
versions of the operating system.
47
Installation:
To install DOS v4.0, you can use the SYS command on discs
with a previous installation of DOS, but newcomers or those
who want to redefine a drive with more that 32MB will have
to format their disc. A new menu -driven program, called
SELECT, can guide the user through installation and
automatically creates AUTOEXEC.BAT and CONFIG.SYS files.
After the introductory information screens in which it is
explained that in order to install DOS v4.0 one requires a
blank floppy disc, DOS asks the user to choose between
three levels of installation: minimum, balanced and
maximum DOS functionality, all of which are dependent on
the amount of memory available. Choosing any of these only
varies the amount of information that the installation
program writes to the AUTOEXEC.BAT and CONFIG.SYS
files, with the maximum DOS functionality choice requiring
about 7kB more memory. However, since the files thus
created are unlikely to fit the needs of users with already
implemented systems, the choice of DOS functionality
becomes irrelevant. Such users can continue to use their old
AUTOEXEC.BAT and CONFIG.SYS files.
SELECT then asks the user about the type of keyboard,
printer and the drive and directory onto which r.o install DOS
v4.0, at which point various configuration choices are offered
regarding the AUTOEXEC.BAT and CONFIG.SYS files. Once
accepted, the program first installs DOS on the blank floppy
disc, and then on the hard disc without any further
intervention on the part of the user. The installation process
creates two new files on the hard disc: AUTOEXEC.400 and
CONFIG.400 which contain all the options selected during
installation. Renaming these files with their appropriate
extensions provides bootable files. Users with already
implemented systems must be very careful before renaming
these files, as they will loose their existing ones.
DOS Shell:
One aspect of v4.0 of the operating system makes it
substantially different to earlier versions. This is the result of
the addition of a DOS shell into v4.0, a menu -driven graphics
interface, which makes this version easier to use for
newcomers to the DOS environment; the experienced user
can continue to use the command line. The menus employed
in the DOS shell are consistent with those used in Microsoft
Windows which will make it easier for those who become
familiar with it to migrate to the OS/2's Presentation Manager
- a more advanced operating system which seeks to replace
PC/MS-DOS.
48
However, as OS/2 will only run on PCs based around the
80286 and 80386 processors, the twelve million users with
machines based on the 8086 and 8088 processors will be
confined to the PC/MS-DOS operating system. Thus, the DOS
shell of v4.0 will provide the closest link, be it only an art ficial
one, between DOS and OS/2.
When the program first loads, normally as a result of the
last entry in the AUTOEXEC.BAT in the name of DOSSHELL,
the user is presented with the Start Program screen (see
Fig.1). Along the top and below the date and time bar, there
is an action bar with three pull -down menus with the
captions Program, Group and Exit. This action bar can be
accessed with use of the F10 function key, with Fl providing
help. The first two of these options allow the user tc add
applications to the program list, change their information, or
create more than one list. However, to achieve these the user
must be capable of writing short code -eminiscent to that of
batch files.
Cuomond Prompt
File Systen
Change Colors
DOS Utilities...
Directol
51
backup [options]* External - backs up one or more
files from one disc to a pother. In v4.0
it can also automatically format the
destination disc
Options:
/s backs up sub -directory files to file
in current directory
/m includes files that have been
changed since last backup
/a adds files to be backed up to those
already on the backup disc
without erasing old files
/d backs up only those files which
were modified after a given date
/I makes a backup log entry in a file
called BACKUP.LOG
Example: backup c:\ a:/s
backs up all files on the c: drive onto
the a: drive.
break Internal - sets the Ctrl -C or Ctrl -
Break option.
Example: break ON
cd (or chdir) Internal - changes the working
directory to a different one.
Example: cd\wproc\docs
chcp [nnn] Internal - selects current code page
for as many devices as possible.
Omitting 'nnn' displays the current
code page.
chkdsk (options)* External - analyses the directories,
files and File Allocation Table on the
logged or designated drive and
produces a disc and memory status
report. In v4.0 it also reports the
volume, serial number and disc
allocation units
Options:
/f fixes any problems found during
the check
52
/v causes the display of filespecs as
they are being processed
Example: chkdsk a:/f/v
cls Internal - deers the screen.
command [options] External - starts the command
processor. This is loaded into
memory in two parts: the resident
part and the transient par which can
be overwritten by some progrEms in
which case the transient part is
reloaded.
Options:
/e specifies the environment size in
bytes (defaut = 160 bytes)
/p prohibits command.com from
exiting to a higher level
/c executes a following command
Example command /c chkdsk a:
starts a new command processor
under the current program, runs the
chkdsk command on the disc in the
A: drive, and returns to the first
command processor.
comp External - compares two files and
reports any differences.
Example: comp filet filet
copy [option] Internal - copies one or more files
to specified disc. If preferred, copies
can be given different names.
Option:
/v causes the verification of data
written on the destination disc.
Example: copy *.exe a:/v
copies all files with the .exe
extension to the a: drive with
verification.
53
ctty Internal - changes the standard I/O
console to an auxiliary (aux)
console, and vice versa.
Example: ctty aux
moves all input/output from the
current device (console) to an aux
port such as another terminal. The
command 'ctty con' moves I/O back
to the console.
date InternIal - enters or changes the
current date.
del [option]* Internal - deletes all files with the
designated filespec.
Option v4.0 only:
/p displays filenames to confirm
deletion
Example: del a:*.txt
deletes all files which have the
extension .txt from the a: drive.
dir Internal - lists the files in a
directory.
diskcomp External - compares the contents of
the disc in the source drive to the
disc in the destination drive.
diskcopy External - copies the contents of
the disc in the source drive to the
disc in the destination drive.
dosshell* External - a new v4.0 command
which activates the front-end
graphical interface
exe2bin External - converts .exe files to
binary format.
exit Internal -
exits the command
processor and returns to a previous
level.
54
fastopen [option]* External - store in memory the
location of directories and recently
opened files on a specified drive.
Option:
/x allows use of expanded memory.
If this option is used, then /x option
must also be used with the buffers
command.
fdisk* External - sets up and partitions the
fixed disc for use with MS-DOS and
other operating systems. This
command is also used to display
and change the current active
partition. V4.0 supports an 80 -
column screen. It also has improved
user-friendly commands to allow
disc partitioning in megabytes or
percentages instead of cylinders
fdiskoff External - could have another
name, but it use is to park the fixed
disc heads. This should be done
before moving a computer equipped
with a hard disc to prevent disc
damage.
find [options] External - searches for a specific
string of text in a specified ASCII file
or files.
Options:
/v displays all lines not containing
the specified string
/c prints the count of lines containing
the string
/n precedes each occurrence with
the relative line number in the file.
Example: find "lost words" chapl
searches for the string 'lost words'
(which must appear within full
quotes) in the named file (chapl ).
55
format [options]* External - formats the disc in the
specified drive.
Options:
/8 formats with 8 sectors per track
/4 formats a double -sided disc with 40
tracks, 9 sectors per track for 360 kB
in a high capacity (1.2 MB) disc
drive per track
/n specifies the number of sectors per
track, i.e. /n:9 for nine sectors
/t specifies the number of tracks, i.e.
/t:40 for forty tracks
/v allows a volume label to be given to
the disc
/s copies the system files from the
logged drive
V4.0 also uses:
/f:size to specify disc capacity
/v:label to allow specification of 'label'
without prompting after
formating
Example: format a:/4/s
graftabl* External - loads a custom designed,
colour graphics font table into
memory. In v4.0, the multilingual
code page 850 is now supported
graphics* External - v4.0 now supports EGA
and VGA graphics modes to provide
screen dumps to IBM Grapgics,
Proprinters and compatibles
install* External - a new v4.0 command
which provides an improved method
of loading memory -resident pop-up
programs in addition to certain DOS
commands
join External - joins a disc drive to a
specific path.
keyb [xx] External - selects a special keyboard
layout. Omitting xx returns the
current status of the keyboard.
56
label External - creates or changes the
volume identification label on a disc.
and (or mkdir) Internal - creates a new directory on
the specified disc.
mem* External - a new v4.0 command
which reports the amounts of
conventional, expanded and
extended memory that are available
mode [options]* External - sets the mode of
operation on a display monitor,
parallel/serial printer or the RS232C
port. In v4.0 the keyboard repetition
and autorepeat start delay time can
be set. Also, it allows the setting of the
number of rows to any of 25, 43 or 50
on the screen, and there is a wider
range of serial -port configurations
Options:
Display: mode in]
40 sets display width to 40
characters per line
80 sets display width to 80
characters per line
bw40 sets screen to black and white
display with 40 characters
bw80 sets screen to black and white
display with 80 characters
co40 sets screen to colour display
with 40 characters
co80 sets screen to colour display
with 80 characters
mono sets screen to monocl-rome
with 80 characters
Printer: mode LPTi: [n][,[m][,p]]
i sets printer number with legal values
from 1 to 3
n sets number of characters per line
with legal values of 80 or 132
m sets the number of lines per inch
with legal values of 6 or 8
p allows continuous reentries on a
time-out error
57
Example: mode LPT1: 132,8
sets the printer in the fist parallel port
to 132 characters per line and 8 lines
per inch
Serial printer: mode LPTi: = COMj
This command redirects all output
sentto one of the parallel printer ports
to one of the serial (RS232C) ports.
Before using this command, the serial
port must be initialised using the 'p'
option of the printer mode command
i sets printer numberwith legal values
from 1 to 3
j sets the serial port with legal values
of 1 or 2
more External - reads data from the
standard I/O and sends output to the
console one screen -full at a time
Example: type read.me more
displays the contents of the read.me
file one screen at a time
nIsfunc External - provides support for
extended country information and
allows the use of chcp command to
select code pages fcr all devices
defined as having code page
switching support.
now External - displays the current date
and time
path Internal - sets and displays the path
to be searched by external
commands or batch files
Example: path c:\;c:\dos;c:\comms
will search the root directory as well
as the dos and comms sub -directories
for files
58
print [options] External - can be used to print text
files in background mode, while other
tasks are being performed. Using the
command without options displays
files already in the print queue
Options:
/d specifies the print device such as
PRN or AUX
/b sets size of internal bufferwith legal
values from 512 to 16384 bytes,
speeding up printing
/q specifies the number of files in the
print queue, normally 10, with legal
values from 4 to 32
/t allows cancellation of files in print
queue
prompt Internal - changes the command
prompt
Example: $p$g
which allows the path of the current
working directory to be displayed as
the prompt
rd (or rmdir) Internal - removes the specified
directory
recover External - recovers a file or an entire
disc containing bad sectors
ren (or rename) Internal - changes the file name
Example: rena:\docs\merr o1memo2
will rename the memol file, which is
to be found in sub -directory docs on a
disc in the a: drive, to memo2
replace [options]* External - allows easy updating of
files from a source disc to a target disc
of files having the same name
Options:
/a also adds files that exist on the
source disc but not on the target
disc
59
/d replaces files in the destination disc
only if the source files are newer
/p prompts the user before replacing
/r replaces read only files
V4.0 also uses:
/u updates files with a time and date
on the source disc more recent than
those on the destination disc
restore [options] External - restores one or more files
that were backed up using the
'backup' command
Options:
/s restores files in the specified
directory and all files in any sub -
directories of the specified directory
/p prompts user before overwriting an
existing file by restoring
select* External - sets the formats for date
and time, currency sign and decimal
point convention. In v4.0 there are
full -screen installation and help
routines
set Internal - sets strings into the
command processor's environment.
The general form of the command is:
set [name=[parameter]]
Set by itself displays the current
environment
share External - installs file sharing and
locking
sort [options] External - reads data from the
console or a file, sorts it and sends it
to the console or file
Options:
/r sorts in reverse order
60
Example: dir sort
sorts the output of the 'dir' command
in alphabetical order
subst External - allows substitution of a
virtual drive for an existing drive and
path
Example: subst e: a:\wproc\dots
will cause future reference to drive d:
to be taken as replacement to the
longer reference to a:\wproc\docs
switches* External - a new v4.0 command
which forces the conventional
keyboard layout on to an enhanced
keyboard
sys* External - transfers the PC/MS-DOS
system files from the logged drive to
the disc in the specified drive. V4.0
allows the specification of source
drive and path commands to transfer
system files across a network
time* Internal - displays and sets the
system time. In v4.0 a 12- or 24 -hour
format is supported
tree* External - displays the directory
structure. In v.40 the display is shown
graphically
type Internal - displays the cortents of a
file on the console
vdisk External - allows the setting up of
RAM memory as a virtual disc. In v4.0
the /x option can be used to allow the
virtual disc to -eside in expanded
memory
ver Internal - displays the PC/MS-DOS
version number
verify Internal - allows the verify switch to
be turned ON or OFF
61
Example: verify OFF
vol Internal - displays the disc volume
label, if it exists
xcopy [options] External - copies files and
directories, including lower level sub -
directories, if they exist, to the
destination drive and directory
Options:
/a copies source files that have their
archive bit set
/d copies source files which were
modified on or after a specified date
/e copies sub -directories even if they
are empty - use this option in
conjunction with the /s option
/m copies archived files only, but also
turns off the archive bit in the
source file
/p prompts the user with "(YIN?)"
/s copies directories and their sub -
directories unless they are empty
/v causes verification of each file as it
is written
62
GLOSSARY OF TERMS
ASCII It is a binary code representation of a
character set. The name stands for
"American Standard Code for
Information Interchange".
AUTOEXEC.BAT A batch file containing commands
which are automatically executed on
booting up the system.
BASIC A high level programming language.
The name stands for "Beginner's All-
purpose Symbolic Instruction Code".
BIOS The Basic Input/Output System. It
allows the core of the operating system
to communicate with the hardware.
Buffer RAM memory allocated to store data
being read from disc.
Byte A grouping of binary digits (0 or 1)
which represent information.
Cluster A unit of one or more sectors. It is the
minimum amount of space that can be
allocated to a file on disc.
COMMAND.COM The Operating System's Command
Processor which analyzes what is typed
at the keyboard and causes execution
of appropriate commands.
CONFIG.SYS A special file that allows the system to
be configured closer to requirement.
Directory An area on disc where information
relating to a group of files is kept.
DOS The Disc Operating System. A
collection of small specialised pro-
grams that allow interaction between
user and computer.
63
FAT The File Allocation Table. An area on
disc where information is kept on which
space on disc has been allocated to
which file.
File The name given to an area on disc
containing a program or data.
Filespec File specification made up of drive,
path, filename and a three letter
extension.
FORTRAN A high level programming language. It
stands for FORmula TRANslation.
Memory Part of computer consist ng of storage
elements organised into addressable
locations that can hold data and
instructions.
Prompt The System prompt displayed on
screen (usually A> or C>).
RAM Random Access Memory. The micro's
volatile memory. Data held in it is lost
when power is switched off.
ROM Read Only Memory. The micro's non-
volatile memory. Data are written into
this memory at manufacture and are
not affected by power loss.
Root Directory The main disc directory under which a
number of sub -directories can be
created.
Sector Disc space, normally 512 bytes long.
SHELL A front end to MS-DOS or an alternative
Command Processor.
SYSTEM A BASIC command which causes exit
from BASIC and return to MS-DOS.
System Short for computer system, implying a
specific collection of hardware and
software.
System Disc A disc containing MS-DOS' three main
files and other Utilities.
64
INDEX
ANSI.SYS 34
APPEND command 38, 51
ASCII files 25
AUTOEXEC.BAT file 5, 21, 35
ASSIGN command 51
ATTRIB command 51
BACKUP command 44, 52
BASIC 9, 38
Batch
file commands 39
FOR 39
GOTO 40
IF 40
REM 40
SHIFT 40
files 36
use of KEYBUK 36
use of CLS 37
use of ECHO 37
use of PATH 37
use of PROMPT 37
use of VER 37
use of % 39
BIOS 4
Booting up 4
BREAK command 6, 31, 32, 52
BUFFERS 31, 32
Built-in commands 6
CD command 6, 21, 22, 52
CHCP command 52
CHKDSK command 17, 52
CLS command 6, 53
CODEPAGE command 33
COM.SYS 34
COMMAND.COM 3, 18, 53
Command processor 3
Commands, built-in 6
COMP command 15, 53
Comparing discs 15
Comparing files 15
CONFIG.SYS 5, 31
Configure the system 31
COPY command 6, 14, 53
65
Copy mode (EDLIN) 28
COUNTRY 31, 32
Ctrl -Alt -Del 5
Ctrl -C 31
Ctrl -S 42
Ctty command 54
Current line (EDLIN) 26
DATE command 6, 11, 41, 54
DELete command 6, 16, 54
Delete mode (EDLIN) 28
DEVICE 33
DIR 4, 7, 54
/P option 8
/W option 8
wildcard characters 9
Directing I/O 42
Directories 4, 19
Disc capacity 13
DISKCOMP command 15, 54
DISKCOPY command 15, 54
DOS
SHELL command 48, 54
Versions 1
v4.0 48
DRIVER.SYS 34
ECHO 6, 37
Edit mode (EDLIN) 27
EDLIN 25
EGA.SYS 34
EXE2BIN command 54
EXIT command 54
Exit EDLIN 30
FASTOPEN command 55
FAT 17
FDISK command 4, 55
FDISKOFF command 55
FILES 31, 34
Filenames 8
Filters 43
FIND command 55
FORMAT command 11, 56
GRAFTABL command 56
GRAPHICS command 56
IBMBIO.COM 3
IBMDOS.COM 3
66
Input/Output (I/O) 2
Insert mode (EDLIN) 26, 27
INSTALL command 56
IO.SYS 3
JOIN command 56
KEYB command 56
KEYBOARD.SYS 36
KEYBUK command 36
LABEL command 57
LASTDRIVE 35
Line editor 25
List mode (EDLIN) 26
MD command 6, 21, 22, 57
MEM command 57
MODE command 57
MORE filter command 43, 58
MOUSE.SYS 43
Move mode (EDLIN) 28
MSDOS.SYS 3
NLSFUNC command 58
NOW command 58
Options with
BACKUP 44
CHKDSK 17
COMMAND.COM 18
COPY 14
DEVICE 33
DIR 8
FORMAT 11
PRINT 43
RESTORE 44
XCOPY 17
PATH command 6, 37, 58
PRINT command 43, 59
PRTSC command 44
PRN redirection 42
Prompt 4
PROMPT command 6, 21, 37, 59
Quit EDLIN 30
RAM 5
RD command 6, 21, 24, 59
RECOVER command 59
67
Redirection 42
REName command 6, 16, 59
REPLACE command 59
Replace mode (EDLIN) 29
RESTORE command 44, 60
ROM 5
Root directory 19
Search mode (EDLIN) 28
SELECT command 48, 60
SET command 6, 41, 60
SHARE command 60
SHELL 35
SORT filter command 43, 60
Sub -directories 19
SUBST command 61
Switch 8
SWITCHES command 61
SYS command 13, 61
System disc 3
68
A Concise
Introduction to MS-DOS
If you are a PC user and want to get the most out of your computer in efficiency and
productivity, then you must learn its PC/MS-DOS operating system. With this CONCISE
INTRODUCTION TO MS-DOS you will learn to do just that in the shortest and most
effective way.
The book was written with the non -expert, busy person in mind and, as such, it has
an underlying structure based on "what you need to know first, appears first". None-
theless, the book has also been designed to be circular, which means that you don't have
to start at the beginning and go to the end. The more experienced user can start from
any section.
The book explains:
How the DOS operating system is structured so that you understand what
happens when you first switch on your computer.
How to use the DOS commands to perform various house -keeping operations on
your disc files.
How to use the EDLIN line editor to fully configure your system by writing your
own CONFIG.SYS and AUTOEXEC.BAT files.
How directories and sub -directories can be employed to organize the way you
keep files on your disc so that your system's efficiency is maximized.
How to write batch files to automate the operation and use of your system.
How to manage your system's environment.
The book covers all versions of 3.x of both PC -DOS and MS-DOS as implemented by
and other manufacturers of "compatible" microcomputers, including the AMSTRAD
Cs. Coverage extends to both the floppy disc -based and hard disc -based systems. A
separate section deals with the DOS shell of version 4.0, which is a menu -driven graphical
interface making this version of the operating system easier to use. Familiarity with this
version of DOS will make migration to the new operating system OS/2 that much easier.
ISBN 0-85934-177 1
00295
£2.95
9 780 11 9 34 1776