Contents of the CHD.DOC file
Name - CHD.COM
Source - CHD.C using the Datalight C Compiler v2.20
Author - Stephen Barsky
Date - 1/28/87
CHD is a replacement for the DOS CHDIR command. On my system, I've
used the utility program DOSEDIT to actually replace the CD command
CHD allows you to change directories without having to enter the
entire path name. The strategy is as follows:
1) CHD tries to apply the CHDIR command directly to the name
specified on the command line. For example, CHD \TURBO will first
try to make \TURBO the working directory. CHD TURBO will try to
find a subdirectory called TURBO under the current working directory.
This is identical to the normal CHDIR command.
2) If the first step fails, then CHD tries to find the specified
directory under the root directory. For example, if you are
currently in the directory \TURBO and you enter CHD SNOBOL, an
attempt is made to find the subdirectory SNOBOL under \TURBO. If
this fails, then an attempt is made to make \SNOBOL the current
3) If the first two steps fail, then CHD tries to find any directory
or subdirectory whose name includes the name specified on the
command line. The name search begins at the top of the root
directory, and works down, searching every subdirectory along the
way. For example, if under your root directory you have 3
subdirectries, SNOBOL, COBOL, and SPITBOL (in that order), then
entering CHD BOL will place you in \SNOBOL. Entering CHD SP will
place you in SPITBOL.
4) If the first three steps fail, then CHD displays "Invalid
directory," just as with the normal CHDIR command.
5) If no arguments are submitted to CHD, then the current directory
name is displayed, just as with the normal CHDIR command.
CHD will not apply steps 2 and 3 correctly is a drive specifier is used.
For example, CHD C:\TUR will not find the directory \TURBO on the C
drive. CHD C:\TURBO will work correctly.
The idea is to be able to traverse the directory tree without having
to do a lot of typing or remembering exactly where everything is.
One note of caution - be sure that you use a DOS prompt that displays
the name of your current directory. This way you can always be sure
that you are in the directory you expect to be in.