Vous êtes sur la page 1sur 13

50 X TOPIC 4 MS-DOS

Topic X MSDOS
4
LEARNING OUTCOMES
By the end of this topic, you should be able to:
1. Explain what is meant by MS-DOS and describe its application;
2. Type correctly the MS-DOS commands; and
3. Use MS-DOS commands to perform computer housekeeping
activities.

X INTRODUCTION
Before Windows was introduced, the commonly used operating system for a PC
was MS-DOS. This topic will stress on the introduction and application of MS-
DOS. The MS-DOS commands used are based on MS-DOS 5.0 and later versions.

4.1 INTRODUCTION TO MS-DOS


DOS is the abbreviation for Disk Operating System produced by Microsoft for
IBM PC use and was introduced in 1979. The first version of DOS was DOS 1.0
while DOS 7.0 was produced in 1995.

MS-DOS actually has an interesting history. IBM (International Business


Machine), which was the biggest computer manufacturer at that time, proposed
the manufacture of microcomputers or PCs. They discussed with Bill Gates (the
founder of Microsoft) the creation of an operating system for computers. The time
given was so short that he came out with a very simple operating system. Later,
Microsoft continually improved this software by increasing a variety of
additional features until it became what it is today.

At present, with the availability of Windows, the use of MS-DOS is gradually


declining. However, MS-DOS still plays an important role in controlling the
travelling path of computer systems.

Copyright Open University Malaysia (OUM)


TOPIC 4 MS-DOS W 51

Briefly, the development of Microsoft DOS (MS-DOS) can be summarised as


follows:

Version Year Features


1.0 1981 Original version of DOS
1.1 1982 Supports double-sided disks
2.0 1983 Supports sub directories
2.01 1983 Supports the use of international symbols
2.25 1983 Corrects errors
3.0 1984 Supports more character sets and bigger discs
3.1 1984 Supports PC networks, bug fixes.
3.2 1986 Supports the use of 3.5-inch discs
3.3 1987 Supports the use of PS/2 computer

4.1.1 Why MS-DOS?


Why do we still use MS-DOS even though MS-Windows is more sophisticated
and easier to use?

This question can be answered by the fact that there are still some applications
that cannot be performed by the graphic interface-based MS-Windows.

Foe example, you surely must have come across a statement like: "path not found.
Please check the location of your program and correct the path". This problem
may happen especially when you are involved in developing a website. This
problem can only be rectified by using MS-DOS.

Understanding MS-DOS will assist users to understand the workings in an MS-


Windows environment (setting up computer system, optimising performance
and troubleshooting).

4.1.2 Access to MS-DOS


Before the emergence of MS-Windows, whenever we activate a computer, we will
be immediately provided with the MS-DOS interface. Now MS-DOS is included
as an application in MS-Windows. To get into MS-DOS, do the following steps:

(a) Click the Start button.


(b) Click the Program instruction.
(c) Click Accessories.
(d) Click the MS-DOS Prompt submenu.

Copyright Open University Malaysia (OUM)


52 X TOPIC 4 MS-DOS

You will be provided with a window showing a prompt like the one below:

C:\Windows>

This means you can now give MS-DOS commands by typing the desired
commands by the side of the prompt.

If you follow the method explained above, you are actually still under the control
of the MS-Windows operating system but give commands the MS-DOS way. To
be fully under the control of MS-DOS, we can carry out the following steps:

(i) Click the Start button.


(ii) Click Shut Down.
(iii) Choose Restart in MS-DOS mode option.

4.1.3 Important Terms


There are some important terms you have to understand before continuing
lessons on MS-DOS (Table 4.1).

Table 4.1: MS-DOS Terms

Term Definition
File The main storage unit in the computer. For example, if you
use Word to store particular information, it will be stored
according to its type. As such, each file has a name that, by
itself, explains the kind of information contained in the file
Directory It is used to store a group of inter-related files
Subdirectory A directory located in another directory
Root Directory All directories are subdirectories except one i.e. the root
directory. The Root Directory is a base for other directories
which are broken up according to their specific importance,
for instance c:\>
Drive It is represented by a drive letter where it appears as a
collection of directories. It is usually referred to as disk, for
example, floppy disk, hard disk and compact disk.
Drives A and B are used to indicate floppy disks.
Drive C is always referred to as the hard disk.
Additional drives, D, E and so on, refer to compact disks.

Copyright Open University Malaysia (OUM)


TOPIC 4 MS-DOS W 53

The use of channels or pathways to determine the location of a file is shown in


Figure 4.1.

Figure 4.1: Structure of MS-DOS directory

From the structure explained above, we can see that the full name of a file like
tomyam.doc is as shown in Figure 4.2.

Figure 4.2: The full name of a File in MS-DOS

Self-check 4.1
1. State the differences between root directory, directory and subdirectory.

2. State the differences between the interfaces of Windows and DOS.

Copyright Open University Malaysia (OUM)


54 X TOPIC 4 MS-DOS

4.2 MS-DOS COMMANDS


MS-DOS is a command driven interface. This is because every command that is
intended to be carried out is typed after the prompt sign,

C:\Windows>

This prompt means that you are in the C drive and Windows directory. The
command can be typed either in capital letters or small letters.

4.2.1 Basic Commands


The following are some basic commands that can be used:

(a) ver: the system will display a version of the operating system.
(b) dir: the system will display the contents of the directory.
(c) cd: Directory change.

All names followed by <DIR> are directories (the same as folders in Windows).

For example:

C:\Windows>dir

will display all the files and directories available in the Windows directory.

In order to make you skilful in the use of the stated commands, please do the
following exercise:

Activity 4.1

Enter the MS-DOS Prompt.

You will be in the Windows directory.


Change your directory to root directory using the command:
cd.

Type dir. What do you see?


Try typing dir/p. Can you see any difference?
What about dir/w?
What happens if you type dir/p/w?

Copyright Open University Malaysia (OUM)


TOPIC 4 MS-DOS W 55

From the activity above, we will know that MS-DOS commands can be expressed
in many ways, for example:

dir
dir/p
dir/w
dir/p/w

dir is a command name, whereas /p and /w are options provided for the dir
command. In MS-DOS terms, this option is known as switch.
Besides that, a command can have arguments, for instance:
dir windows
In this case windows is an argument to the dir command.

Self-check 4.2

If, at C:\> prompt, you type cd\ wp. What will happen?

4.2.2 Creating a New Directory


Creating a new directory is very important if the user wishes to make file
management easy.

To create a new directory, we need to use the md command.

Copyright Open University Malaysia (OUM)


56 X TOPIC 4 MS-DOS

Activity 4.2
Please do the following exercise to improve your skill in the use of the
following commands.
Create and change to a new directory named oum by using the
command:
C:\>md\oum
To open the mentioned directory type cd \ oum
To create a new directory in the oum directory i.e. tekmakl, you can
type
C:\>md tekmakl
Carry out the command

C:\>cd tekmakl
What is the displayed prompt?
To return to the oum directory, you can type the instruction cd.
(two dots after cd). What is the displayed prompt?

Self-check 4.3

If the prompt displays C:\unit>, and you enter md this, then you ..

4.2.3 Deleting a Directory


The command to delete a directory is rd (remove directory).
To delete the tekmakl directory, make sure you are at the command prompt:
C:\oum>. Then type the instruction rd tekmakl.

4.2.4 To Change Drive


A computer system has several drives. In standard practice, the naming of drives
is as follow:

Copyright Open University Malaysia (OUM)


TOPIC 4 MS-DOS W 57

a: Floppy disk drive;


b: Second floppy disk drive, if any;
c: Hard disk drive; and
d: Optical disk drive.

In certain computers, there might be two hard disks; therefore, the name of the
drive may be changed to:

d: Second hard disk drive; and


e: Optical disk drive.

If you wish to change drive from hard disk to floppy disk, you must make sure
that the floppy disk is first inserted into its drive. Then type the command

a:

Activity 4.3

1. How do you view the list of files and directories available in drive a:?
2. What will happen if you change to drive a: when there is no diskette in
that drive?

4.2.5 Copying File


Suppose a user wishes to copy an existing file in the Windows directory named
unit2.doc to the oum directory, the steps to be taken are:
Make sure you are in the Windows directory. This can be observed through
its prompt, that is, c:\windows>
To copy a file, you can apply the command:
copy c:\windows\unit2.doc c:\oum
A message stating 1 file(s) copied will be displayed.

4.2.6 Changing File Name


To rename a file, the command to use is ren or rename. This command format is:
ren [old name][new name]
For example: ren tekmakl tm

Copyright Open University Malaysia (OUM)


58 X TOPIC 4 MS-DOS

4.2.7 Deleting a File


To delete a file the command del (delete) is used. This command format is:
del [filename]
To retrieve deleted files, we can use the command undelete. This command
format is
undelete drive:\path\file(s) /switch
the switch provided is:
List the listing of all the files that have been deleted but not yet
overwritten.
All undelete all deleted files without requesting the user's certainty.
Example: To retrieve a file named Hello.bat
undelete a:\hello.bat
Therefore, the process flow of retrieving the file is as follows:
Directory: A:\
File specifications: HELLO.BAT
Deletion-tracking file not found.
MS-DOS directory contains 1 deleted file.
Of those, 1 file may be recovered.

Using the MS-DOS directory method.


?ELLO BAT 49 1/1/96 16:23 A Undeleted (Y/N)? Y
Please type the first character for ?ELLO.BAT: H
File successfully undeleted.

4.2.8 Printing a File


The instruction for printing a file is:
print [drive:][path][filename]

4.2.9 Diskcopy
This command is used to copy the whole diskette on to another diskette. The
format is:

DISKCOPY [source drive:[target drive]]

Copyright Open University Malaysia (OUM)


TOPIC 4 MS-DOS W 59

However, both diskettes must be of the same type and have been formatted with
the same format. In other words, we can only copy files from a 5.25-inch disk to
another disk of the same size.

If the computer is equipped with two floppy disk drives a: and b:, we can insert
the original disk in drive a: and the targeted disk in drive b, and then use the
command:

DISKCOPY a:b

If the computer has only one floppy disk drive, i.e. a: drive, we can still use this
command by typing:

DISKCOPY a:a

To execute this command, we need to insert the original disk into a:drive and
then eject it. Finally, insert the targeted disc into the same a:drive.

4.3 FILE AND DIRECTORY NAME


As was explained when discussing MS-Windows all files and directories must
have a name except for the root directory. The following are conditions which
must be followed when naming a file or directory.

The length of the name must not exceed eight letters and the maximum extension
permitted must not exceed three letters. For example unitem.txt

(a) Not case-sensitive; no difference in the use of small or capital letters. For
instance, oum.txt is similar to OUM.TXT. It refers to the same file.
(b) The name must be in the form of alphabets (a..z), numbers (0..9), or symbols
_,^,$,~,!,#,%,&,-,{},@,,(). Other characters are not allowed.
(c) The name must not contain a blank space, comma, backslash or dot except
dot in extension to separate the name of a file from its extension).
(d) The name of a file or subdirectories must not be same as the name of its
directory.

Copyright Open University Malaysia (OUM)


60 X TOPIC 4 MS-DOS

4.4 THE APPLICATION OF WILDCARD


MS-DOS provides wildcard to allow us to perform the same action on a group of
files. MS-DOS recognises two types of wildcard; '?' represents a letter while '*'
represents one or more letters. An example of a file name using wildcard is as
follows:

Activity 4.4
1. You wish to rename all the files with the .txt extension with the same
name but with a new extension .abc. All the files are located in the
FILE directory. The prompt displays c:>\windows. The command to
use is
2. You wish to delete a file named my.fil, which is located in the root
directory, floppy disk. The prompt displays c:\wim. The command
you use is .
3. If the prompt displays c:\media\movies. You type cd.., then you
would have changed the directory default to .

Table 4.2: The Application of Wildcard

Wildcard Definition Example


All files with the txt File1.txt
*.txt
extension Document.txt
All files named report Report.txt
Report.txt but followed by any Report.doc
extension Report.xls
All files beginning with Memo.txt
M*.* the letter M and followed Meeting.doc
by any extension
All files with 3-letter Win.ini
???.* names and followed by Exp.sys
any extension. Sun.bmp

We can use wildcard to execute a command on a group of files. For example,

copy *.doc c:\unitem

Copyright Open University Malaysia (OUM)


TOPIC 4 MS-DOS W 61

The computer will copy all files with the extension doc from the current directory
to the c:\unitem directory.

Activity 4.5
1. What is carried out by the following commands?
(a) del *.doc
(b) xcopy a:*.* b:
(c) undelete ?ello?.*

2. You wish to copy all files with the extension .abc to the alpha
subdirectory in c drive to floppy disk. The prompt displays c:\file>.
The fastest way to issue the mentioned command is

3. You want to delete the file named fun.one in the humour


subdirectory in the c drive. The prompt displays c:\tp>. The
command is ..

Activity 4.6
If you are keen to do additional reading on MS-DOS, please visit this
website, http://burks.bton.ac.uk/burks/pcinfo/osdocs/dosintro.htm

SUMMARY
It is hoped that this topic has been able to give a brief picture of the

application of MS-DOS and the application of simple and easy commands


in the process of file and directory management.
Nevertheless, less people are using MS-DOS nowadays due to the presence
of Windows.
Another reason is that, there are some commands in Windows 95 (and
above) that cannot be performed by MS-DOS.

Copyright Open University Malaysia (OUM)


62 X TOPIC 4 MS-DOS

KEY TERMS
MS-DOS Root Directory
File Drive
Directory Wildcard
Subdirectory

Copyright Open University Malaysia (OUM)

Vous aimerez peut-être aussi