SpartaDOS X Reference Manual

The Command Processor — Advanced Features




The Command Processor — Advanced Features

Index


Search Path  

Whenever a command is given to the command processor without a drive and/or path being specified, a check is made to see if it is an internal command (such as ERASE). If not, the list of installed external commands (such as TD or KEY after they have been run once) is searched. If the command is not found, then a check is made to see if the environment variable PATH exists. If it does, all of the devices and/or paths named in the variable are checked for the command in the order specified. If the command is still not found, the default directory is searched. The PATH variable provides a high degree of flexibility and power, allowing you to keep often used utilities out of the way in subdirectories. This is particularly useful if you own a hard drive, since the main directory of D1: can get very cluttered.

You can examine the PATH variable by typing

    PATH

with no parameters at the CP prompt. The default PATH is

    CAR:

The search path may be changed by typing

    PATH path1;path2;...;pathn

at the CP prompt. Each device and/or path specified must be separated from the others with a semicolon (;). It is a good idea to leave CAR: as the first entry, since many often used commands are in this device and it can be accessed much more rapidly than the others. Order is important, since the entries will be searched one after the other. For example,

    PATH CAR:;A:\DOS\;A:\TOOLKIT\;D9:>;A:>;:>

will search the CAR: device, the directory DOS on D1:, the directory TOOLKIT on D1:, the RAMDISK at D9:, the main directory of D1:, the main directory of the default drive, and then the current directory of the default drive.

If a path is specified on the command line, this search path will not be used.


Previous page

Next page