TO Utility

TO is a DOS utility that allows you to go to a directory without typing

CD path

or

CD ..\path

TO is probably the DOS utility I use most because it allows me to move between directories very quickly. At the DOS prompt, simply type TO followed by the name you associated with a directory, then press Enter:

TO name

where name is a name you associated with a path. The names and paths are placed in an ASCII file called TO.TBL, which resides in the root directory of the current drive. TO scans TO.TBL for the name you specified on the command line. If the name exists in TO.TBL, the directory is changed to the path specified with the name. If name is not found in TO.TBL, the message Invalid NAME. is displayed.

The DOS executable is in \SOFTWARE\TO\EXE\TO.EXE, an example of the names and paths is in \SOFTWARE\TO\EXE\TO.TBL, and the source code is in \SOFTWARE\TO\SOURCE\TO.C.

An example of TO.TBL and its format is shown in Listing D.1. Note that the name must be separated from the path by a comma.

Listing - Listing D.1 Example of TO.TBL
A,          ..\SOURCE
C,          ..\SOURCE
D,          ..\DOC
L,          ..\LST
O,          ..\OBJ
P,          ..\PROD
W,          ..\WORK
EX1L,       \SOFTWARE\uCOS-II\EX1_x86L\BC45          (1)
EX2L,       \SOFTWARE\uCOS-II\EX2_x86L\BC45
EX3L,       \SOFTWARE\uCOS-II\EX3_x86L\BC45
Ix86L,      \SOFTWARE\uCOS-II\Ix86L\BC45
TO,         \SOFTWARE\TO\SOURCE
uCOS-II,    \SOFTWARE\uCOS-II\SOURCE 


You can add an entry to TO.TBL by typing the path associated with a name on the command line as follows:

TO name path

TO appends this new entry to the end of TO.TBL. This avoids having to use a text editor to add a new entry. If you type

TO EX1L

TO changes directory to \SOFTWARE\uCOS-II\EX1_x86L\BC45 [LD.1(1)].

TO.TBL can be as long as needed, but each name must be unique. Note that two names can be associated with the same directory. If you add entries in TO.TBL using a text editor, all entries must be entered in uppercase. When you invoke TO at the DOS prompt, the name you specify is converted to uppercase before the program searches through the table. TO searches TO.TBL linearly from the first entry to the last. For faster response, you may want to place your most frequently used directories at the beginning of the file although this may not be necessary with today’s fast computers.

Related pages