" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#008000" VLINK="004000" ALINK="#00C000">
SUBST (Substitute) COMMAND
Purpose: Allows to substitute a drive letter or a path for a one-letter
drive identificator.
Note: If the application doesn't recognize paths, the SUBST command
allows to use drive letter instead of the path.
Syntax: [d:] [path] SUBST d: d:path
Type: External command
Parameters:
[d:] [path] before the command defines the drive and the path to the
SUBST command.
d: - drive letter to be used instead of the other drive letter
or the path.
d:path - the drive letter or the path you want to access.
The specified path should begin in the root directory.
/D - cancelling of the substitution. You should specify the letter
of the drive you want to abort. For example, if you substitute
the path C:\LEVEL1 for G, the substitution will be cancelled
by the command:
A>subst g: /d
The substitution letter may range from A to Z. It is used as a petname
for the disk or the long path to call. For example, if G is used to
substitute the long path C:\LEVEL1\LEVEL2, you may call
C:LEVEL1\LEVEL2\file1 just typing:
A>dir G:file1
instead of
A>dir C:\level1\level2\file1
Notes:
1. The letter of the drive you can use for the substitution, depends on
the meaning of the LASTDRIVE in the environment. If the LASTDRIVE
parameter is absent in the CONFIG.SYS file, the default value is
LASTDRIVE=E, so you may use for substitution only A, B, C, D, and E
letters.
2. Drive letters in the command parameters should differ.
3. The default drive letter cannot be the first parameter.
4. If you specify the path, it would begin in the root directory.
5. You would not use a network disk as a parameter. Otherwise, the
following message will be displayed: "Cannot SUBST a network drive".
6. Be careful executing CHDIR, MKDIR, RMDIR and PATH commands on drives
used in the SUBST command.
7. The following commands do not work on drives used in the SUBST command:
ASSIGN, BACKUP, DISKCOMP, DISKCOPY, FDISK, FORMAT, JOIN, LABEL, and
RESTORE.
8. The SUBST command without any parameters displays this current
substitution: G: => D:\path
9. The Invalid Parameter message means that:
- the specified drive letter isn't valid;
- there is an attempt to substitute the default drive;
- the parameter /D was specified without the drive letter.
10.If you specify an unexisting path, the system will prompt you with the
message: Invalid Path.
Example:
Lets assume that, the default drive is B, the current directory is
C:\REPORTS\FILES, LASTDRIVE=H.
+--------------+
| C:\ |
+-------+------+
|
+-----------------+-----------------+
| |
+-----+-----+ +----+------+
| REPORTS | | GAMES |
+-----+-----+ +-----------+
|
+-----+-----+
| FILES |
+-----------+
1. How to substitute:
B>subst g: c:\reports\files
substitutes the path C:\REPORTS\FILES for the drive letter G. After the
substitution the command
B>dir g:
displays the directory C:\REPORTS\FILES. Remember, the drive letter cannot
be other than any of those allowed by the LASTDRIVE command.
2. How to display the current substitution:
B>subst
This command displays the following message:
G: => C:\REPORTS\FILES
The message means, that disk G substitutes the directory C:\REPORTS\FILES,
i.e. when you call the disk G the command calls the directory
c:\REPORTS\FILES.
3. How to cancel the substitution:
The following command cancels the current substitution:
B>subst g: /d
How to use the SUBST command:
The substitution of the drive letter for a path is useful with
applications, that do not recognize paths. For example, if you want to edit
the RECIPES file from the directory C:\FOOD\FILE, you can substitute the
path for the drive letter F. After this you can call the file in this way:
F:RESIPES. Remember, the substitution is possible for LASTDRIVE=F at least.