Exercise 64
A flashing cursor displays after the path name. This is called the command prompt and it is here
that you enter the DOS commands. Simply type the command you wish to use and press the Enter
key to perform the action.
Note It is important to note that when you enter commands into DOS you can potentially change
settings from within Windows, delete important files, etc. Be careful that you do not cause
unintentional damage.
Writing in DOS
To be able to use DOS (or any command line system), you need to be able to write in a code which
the computer can understand. DOS has a series of commands which you can enter to perform
different tasks. Some of the commonly used commands are described below.
Note DOS commands are not case sensitive. It is just convention which sees them typed in
capital letters.
DIR - Directory
This command lists all the files and folders contained within the current directory.
Exercise 65
EXAMPLE
TESTS ESSAYS
TEST1 TEST2
You would start in the parent directory (the EXAMPLE directory). To move down the hierarchy,
you would type in the CD command followed by a space and the name of the directory you want
to go to. To change to the ESSAYS directory, type in:
CD ESSAYS
It is possible to go down more than one level in the same command. Use a back slash between the
folder and subfolder name. The command below takes you directly from the EXAMPLE folder to
the TEST1 directory:
CD TESTS\TEST1
CD ...
You can also use the command CD to display the pathname of the directory that you are currently
in. If you are unsure what the current directory is, type CD and press Enter to display it.
Note If you want to change drives (e.g. from the C: drive to the A: drive) you do not use the CD
command. Type in the letter of the drive you wish to change to followed by a colon. E.g.
to change to the floppy drive type: A: and press Enter.
DATE
The DATE command will display the current date.
Exercise 66
HELP
Typing Help displays a list of DOS commands and an explanation of what they are for.
Exercise 67
C:
C:
EXERCISE
DOSKEY
Type DOSKEY at the command prompt to load the DOSKEY program. After DOSKEY has been
loaded, you can use the arrow keys to repeat the last command used.
DEL – Delete
The DEL command is used to delete files and folders. You must be in the parent directory OR you
must type the full path name to the file. For example, if you wanted to delete the document
ASMNT2 from the hierarchy shown above you could use the Change Directory command to go to
the ASMENTS folder and type: DEL ASMNT2 OR from the C: drive you could type:
DEL EXERCISE\ASMENTS\ASMNT2.TXT
Note Whereas when you delete a file using Windows, you are generally asked whether you are
sure you want to delete it, when using DOS you will not be asked. Therefore you must be
sure you want to delete the file before using the DEL command.
EDIT
The EDIT command takes you to the Editor and allows you to change the contents of text files
with a character editor.
To edit the file named ASMNT1.txt, type the following command:
EDIT ASMNT1.txt
The mouse can be used when in edit mode to access menus and to click within the text. It is also
possible to use arrow keys to move around the text. Position the flashing cursor within the text
you wish to edit and use the Backspace and Delete keys to remove text. New text can then be
typed.
When you have finished editing, select [File] Exit or press Alt F then X. The Save File message
box will display.
Click on Yes or press Y to save changes to the file. The Command Prompt will return to normal
command mode.
COPY
The COPY command is used to create a duplicate of a file. This file can be created within the
same directory as the original or it can be copied to another folder.
To create a copy of a file, ensure the current directory contains the file (e.g. if you want to copy the
THEORY file you must be in the NOTES folder). Type COPY then the name of the file
(including the file extension) followed by the name of the copy.
This will copy the THEORY text file and create a duplicate in the same folder with the name
THEORY1.