Module3.1 - DOSCommands
Module3.1 - DOSCommands
PLATFORM TECHNOLOGIES
IT0047
MODULE 3
DOS & DEBUG Commands
MODULE 3.1
DOS Commands
Note that there are three entries in the FRUIT directory. One is the
GRAPES directory that you just created. There are two other
entries---one looks like a single period (.) and the other looks like a
double period (..). These directory entries are important to
MSDOS, but you can ignore them. They appear in every directory
and cont ain information
The GRAPES directory is a subdirectory of the FRUIT directory. A
subdirectory is a directory within another directory. Subdirectories
are useful if you want to further subdivide information.
To change to the GRAPES directory, r
type the following at the
command prompt:
cd grapes
The command prompt should now look like the following:
C:\FRUIT\GRAPES>
. To switch back to the FRUIT directory, type the following:
cd ..
The command prompt should now look like the following
C:\FRUIT> r
When the cd command is followed by two periods (..), MS-DOS
moves up one level in the directory structure. In this case, you
moved up one level from the GRAPES directory to the FRUIT
directory
If you no longer use a particular directory, you may want to delete
it to simplify your directory structure. Deleting a directory is also
useful if you type the wrong name when you are creating a
directory and you want to delete ther incorrect directory before
creating a new one.
In this section, you will delete the GRAPES directory. Before you
begin this section, make sure the command prompt looks like the
following:
C:\FRUIT>
To delete a directory, use the rd command. The rd command
stands for "remove directory.“
To delete the GRAPES directory
To delete the GRAPES directory
Type the following at the command prompt:
rd grapes
To confirm that you successfully deleted
r
the GRAPES directory,
type the following at the command prompt:
dir
The GRAPES directory should no longer appear in the directory
list.
Note You cannot delete a directory if you are in it. Before you can
delete a directory, you must make the directory that is one level
higher the current directory. To do this, type cd.. at the command
prompt.
This section describes how to change drives. Changing drives is
useful if you want to work with files that are on a different drive.
So far, you have been working with driveC. You have other drives
you can use to store information. For r
example, drive A is your first
floppy disk drive. The files and directories on drive A are located
on the floppy disk in the drive. (You might also have a drive B,
which contains the files and directories stored on the floppy disk in
that drive.)
Before you begin this section, make sure your command prompt
looks like the following:
C:\FRUIT>
To change to and view files on a different drive
1. Insert a 3.5" floppy disk in drive A label- side up. Make sure the
disk clicks into the drive.
Type the following at the command rprompt:
a:
Note that the command prompt changed to the following:
A:\>
This message may appear:
Not ready reading drive
A Abort, Retry, Fail?
If you see this message, the disk may not be inserted properly.
Place the disk label-side up in the disk drive, and make sure the
disk clicks into the disk drive. Then, type r for Retry. If this
message appears again, press F forr Fail, and then type b: at the
command prompt. If you no longer see this message, type b:
instead of a: throughout the rest of the tutorial.
There must be a floppy disk in the drive that you want to change
to.
Change back to drive C by typing the following at the command
prompt:
c:
Your command prompt should return r
to the following:
C:\FRUIT>
When you type a drive letter followed by a colon, you change to
that drive. The drive letter that appears in the command prompt
shows which drive is the current drive. Unless you specify
otherwise, any commands you type are carried out on the current
drive and in the current directory
This section describes how to copy a single file and a group of files.
Copying files creates a duplicate of the original file and does not
remove the original file. This is useful for many reasons. For example,
if you want to work on a document at r
home, you can copy it from your
computer at work to a floppy disk and then take the floppy disk home.
To copy a file, you will use the copy command. When you use the copy
command, you must include two parameters. The first is the location
and name of the file you want to copy, or the source. The second is the
location to which you want to copy the file, or the destination. You
separate the source and destination with a space. The copy command
follows this pattern:
copy source destination
Copying a Single File
In this section, you will copy the notepad.exe files from the WINDOWS
directory to the FRUIT directory. You will specify the source and
destination of these files in two different
r ways. The difference between
the two methods is explained at the end of this section.
Before you begin this section, make sure the command prompt looks
like the following:
C:\FRUIT>
To copy the NOTEPAD.EXE files from the WINDOWS directory to the
FRUIT directory
Return to the root directory by typing the following at the command
prompt:
cd\
The command prompt should now look like the following:
C:\> r
To confirm that you copied the files successfully, view the contents of
the FRUIT directory by typing the following at the command prompt:
dir \fruit
You should see the file listed in the FRUIT directory
This section explains how to rename files. You may want to rename a
file if the information in it changes or if you decide you prefer another
name.
To rename a file, you will use the ren command. The ren command
stands for "rename." When you user the ren command, you must
include two parameters.
The first is the file you want to rename, and the second is the new
name for the file. You separate the two names with a space. The ren
command follows this pattern:
ren oldname newname
• Renaming a File
In this section, you will rename the README.TXT file
Before you begin this section, make sure your command prompt looks
like the following:
C:\FRUIT>
1. To rename the NOTEPAD.EXE file to PADNOTE.TXT, type the
following at the command prompt:
r
• Deleting a File
In this section, you will delete two files using the del command.
Before you begin, make sure your command prompt looks like the
following:
C:\FRUIT>
To delete the PEARCOM and PEAR.HLP files
1. Delete the PADNOTE.TXT file by typing the following at the
command prompt:
del PADNOTE.TXT
2. To confirm that you deleted the r files successfully, type the
A list of all the files that end with the extension OLD appears. Make
sure that these are the files you want to delete. When you are
deleting files by using wildcards, this step is very important. It will
prevent you from deleting files accidentally.
2. Delete all files ending with OLD by typing the following at the
command prompt: del *.old 3. To confirm that all the files with the
extension OLD have been deleted, type the following at the
2. Delete all files ending with OLD by typing the following at the
command prompt:
del *.old
3. To confirm that all the files with the extension OLD have been
deleted, type the following at ther command prompt:
dir
The FRUIT directory should contain no files.
Now that the FRUIT directory is empty, you can delete it by using
the rd (remove directory) command that you learned to use in
"Deleting a Directory" earlier in this chapter.
2. Delete all files ending with OLD by typing the following at the
command prompt:
del *.old
3. To confirm that all the files with the extension OLD have been
deleted, type the following at ther command prompt:
dir
The FRUIT directory should contain no files.
Now that the FRUIT directory is empty, you can delete it by using
the rd (remove directory) command that you learned to use in
"Deleting a Directory" earlier in this chapter.
To delete the FRUIT directory
1. Return to the root directory by typing the following at the
command prompt:
cd \ r
2. You can see the FRUIT directory in the directory list by typing
the following at the command prompt:
dir or dir /p
3. Remove the FRUIT directory by typing the following at the
command prompt:
rd fruit
To verify that the FRUIT directory has been removed, type the
following at the command prompt:
dir or dir /p
The FRUIT directory should not appear
r
in the directory list.
ASK ANY QUESTION RELATED TO OUR TOPIC
FOR TODAY.