An intelligent replacement for the CD (CHDIR) Command
Procon Construction Systems
WHAT IS CHDDIR?CHDDIR.EXE is a command line program that will switch the current Drive and Directory. It is a flexible and intelligent replacement for the internal COMMAND.COM and CMD.EXE "Change Directory" command (CD or CHDIR).
The CHDIR command is a basic staple of Console operations but is quite limited.
While maintaining basic compatibility with CHDIR, Procon's CHDDIR.EXE speeds keyboard navigation in console modes as it will:-
CHDDIR.EXE also avoids a few anomalies in CHDIR in that it:-
CHDDIR.EXE is a 16-bit program that will work in:-
CHDDIR [Drive:][Directory Path]
CHDDIR [Drive:] [Directory1] [SubPath2] etc.
CHDDIR /HELP - Displays a Help Screen
CHDDIR - Parent Directory (Default)
CHDDIR . - Current Directory
Shows current directory and system time and date.
A useful log command in batch files and scripts.
CHDDIR .. - Parent Directory
CHDDIR ... - GrandParent
CHDDIR .... - Great GrandParent, etc.
CHDDIR \ - Root Directory
CHDDIR MSDEV98\BIN - Relative Path
CHDDIR MSDEV98/BIN/ - Same as above
CHDDIR MSDEV98 BIN - Same as above
CHDDIR M B - Probably the same
CHDDIR M\B - Probably the same
No Local directory 'M' so match 'MSDEV98'.
No Subdirectory 'MSDEV98\B' so match 'MSDEV98\BIN'
CHDDIR H:\WINNT\SYSTEM32 - Full Path with Drive
CHDDIR H: \WINNT SYSTEM32 - Same as above
CHDDIR H:/ WI SYSTEM3 - Probably same as above
CHDDIR d - D or D:\ or \D or perhaps DATA
Local subdirectory 'D',
if not found, Drive 'D:',
if not found, Root Directory '\D',
if not found, match local Directory 'D*',
CHDDIR K UTIL - K\UTIL or K:\UTIL or \K\UTIL
CHDDIR d /u - D\U or D:\U or perhaps D:\UTIL
CHDDIR c \w sys - Probably C:\WINNT\SYSTEM
CHDDIR c \w fo - Windows FONTS Directory?
CHDDIR c /w/fo - Windows FONTS Directory?
CHDDIR "C:\Documents and Settings\All Users"
- Pathnames with spaces must be quoted
CHDDIR %windir% - Probably C:\WINNT
CHDDIR %windir% f - Probably Windows Favourites
INSTALLATION AND USAGE
As CHDDIR is designed to save time and typing, you should make it accessible with a single letter keystroke (e.g., 'Z' or 'C').
You can do this by establishing a
4NT alias for the executable.
For example, the line:-
in a DOSKEY alias definition file would allow you to invoke the command by just typing the single letter Z.
Alternatively, you can just copy (and rename) the file
CHDDIR.EXE into a directory included in the
COPY CHDDIR.EXE D:\UTIL\Z.EXE
would achieve the same result.
When you provide Directory names, e.g., "CHDIR C:\PR SYS" then CHDIR will first look for an exact match (Directory \PR on drive C:).
If this does not exist it will look for the first directory starting with those characters. Hence it might find
The search order is based on the way names are stored in the directory. This is not necessarily alphabetical or by name length, etc., unless you have used a utility to explicitly sort the directories in this way.
LONG PATHNAME SUPPORT
How can CHDDIR - a 16-bit program - support Long Pathnames?
No 16-bit program can provide true "Long Filename" support without low level access to the directory structure (not possible on an Operating System with a reasonable modicum of security) or the use of some form of 32-bit extender technology to access 32-bit Operating System file services (limiting the program to operating under a supported OS).
CHDDIR "fudges" this dilemma by translating Long Pathnames into a "wildcarded" form of their equivalent 8.3 format paths. It then attempts to progressively traverse the supplied path matching each component with existing directories. In practice, this kludge works extremely well on most directory structures. However, it cannot overcome the fundamental ambiguity that one Short pathname can map to more than one Long pathname.
If you find that entering a correctly quoted Long pathname still takes you to the wrong directory, it might be because of this ambiguity. You may have to use the correct Short pathname directly.
The are no DLL or overlay dependencies. The executable can be renamed.
You can download the latest version of CHDDIR from Procon's Website.
Use this utility at your own risk! If you do not understand
you can only cause yourself grief!
Copyright 2003 - Procon Construction Systems
All Rights Reserved