Académique Documents
Professionnel Documents
Culture Documents
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.
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.
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:
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.
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.
Self-check 4.1
1. State the differences between root directory, directory and subdirectory.
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.
(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
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?
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 ..
In certain computers, there might be two hard disks; therefore, the name of the
drive may be changed to:
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.9 Diskcopy
This command is used to copy the whole diskette on to another diskette. The
format is:
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.
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.
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 .
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
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
KEY TERMS
MS-DOS Root Directory
File Drive
Directory Wildcard
Subdirectory