2.4
Directory Commands:
RMDIR
(RD) (Remove Directory)
Type: Internal
Syntax: RMDIR
[d:]path
Purpose: Removes a
subdirectory.
Discussion
RMDIR
removes
directories
that
are
empty.
To
determine
if a
directory
is
empty,
use
the
DIR
command
to
display
the
directory’s
contents.
For
example,
to
determine
if
the
directory
books
is
empty,
enter
dir c:\books
The display of an empty directory
should look like this:
Volume in drive C is IBM_PRELOAD
Directory of C:\books
. DIR 3-05-01 1:23p
.. DIR 3-05-01 1:23p
0
File(s) 0 bytes
2
Dir(s) 1,944,432,640 bytes free
Example
To remove the directory books
from drive C, enter
RD c:\books
To remove the directory ACCOUNTS that
is within the BPB directory on drive C, enter
RD
c:\bpb\accounts
TREE
(Display Directory)
Type: External
Syntax: TREE
[d:][path]
[/A][/F]
Purpose: Displays
directory paths and (optionally) files in each subdirectory.
Discussion
When you use
the TREE command each directory name is displayed along with the names of any
subdirectories within it. The display will be in a format like the summary
below. (Different versions of DOS may display the data in a slightly different
format.)
First, the root
directory and the directories within it are listed (directory names listed in a
five column display):
DIRECTORY PATH LISTING FOR
VOLUME (volume name)
Path is C:
Then each directory within the
root is listed:
Path is: C:\(directory name)
Options
/A - Specifies that
alternative characters (plus signs, hyphens, and vertical bars) be used to draw
the tree diagram so that it can be printed by printers that don`t support the
line-drawing and box-drawing characters (DOS Versions 4 and 5).
/F - Displays the names of
the files found within each directory listed.
Example
To list the directories on the
disk in drive A, enter
Tree a:
PATH
Type: Internal
Syntax: PATH; PATH
[d:]path[;][d:]path[...]
Purpose: Sets or displays
directories that will be searched for programs not in the current directory.
Discussion
PATH tells DOS which directories
should be searched for external commands after DOS searches your working
directory. DOS searches the paths in the order specified in the PATH command.
If you enter the PATH command
without options , the program will display the currently set path designations.
Examples
To tell DOS to search for
external DOS commands and other executable programs in the PROGRAM directory that
is within the root directory on drive C, enter
path c:\program
You can tell DOS to search more
than one path by specifying several pathnames separated by semicolons. For
example:
path
\program;\books;\accounts
To reset the path designation so
that DOS will search only the current directory, enter
Path;
|