XCD - eXtended Change Directory instructions for Total Commander

(tested with Total Commander 6.03a)


Installation:

Copy xcd.exe to a directory that's in the 'PATH' (e.g. C:\WINDOWS\ or C:\WINDOWS\system32\).

Call:

XCD is invoked via Total Commander's command line. Simply type XCD and the "target_directory". (target_directory is the name of the directory you want to change into.)
xcd <target_directory>

In the appearing dialog all (or similar) directories of the same name are listed with complete path (or something similar if no directories of the exact name were found). Now select the directory and click [OK] or press Return.

Note: XCD uses the file "treeinfo.wc" for finding the target_directory which Total Commander puts in the root directory on each local drive. If this file is missing or is no longer current, XCD does not function correctly.

Treeinfo.wc can be updated with Total Commander or with xcd.

Update treeinfo.wc using Total Commander:

Run the "CD Tree" command (Alt+F10) to open the Directory Tree dialog box, then press F2 to re-scan the tree.

Update treeinfo.wc using xcd:

Enter on TC command line Effect
xcd /tree or xcd /treeinfo Treeinfo.wc updated on all local drives
xcd /fg Treeinfo.wc updated only on the indicated drives F: and G:
xcd /tree d:\download or xcd /tree . Only the specified directory will be updated. ("." stands for the current path)

Change directory:

In the following table, is the name of the directory to be changed into. The parameter before indicates the initial position of the search in the directory tree.

The standard behavior of XCD when called without parameters before can be specified in the configuration dialog (function key [F12] or context menu in the XCD window). The initial position of the search is always indicated in the status line if the search is limited to a drive or a directory.

Enter on TC command line Effect
xcd <target_directory> Search for target_directory in all possible paths. Total Commander changes to the directory you select from the results.
xcd Brings up the last search results.
xcd \ <target_directory> Search for target_directory only on the current drive. ("\" stands for root of the current drive)
xcd . <target_directory> Search for target_directory in the current directory and below. ("." stands for the current path)
xcd c:<target_directory; Search for target_directory only on drive C:

The input line below the list of search results always shows the last search word entered. A new search can be started by entering a new search word.

Operation of the dialog box

Keyboard Mouse Effect
up/down click on path in list Select directory in results list.
Ctrl+up/down double-click on path in list (*) Select directory in results list and change directory in Total Commander panel immediately.
RETURN click [OK] (*) Change directory and close xcd.
space/Ctrl click [Apply] (*) Change directory without closing xcd.
ESC click [Cancel] Close xcd.
plus click [<-] Change tolerance threshold. Lists directories matching target_directory less than exactly.
minus click [->]
Alt+down click arrow on input line Opens search history (drop down menu).

(*) With SHIFT key pressed at the same time (or right mouse button) the behavior differs as follows: Change directory to the parent of the selected directory instead of changing into the selected directory. This can be specified as the default behavior in the configuration dialog.

Keyboard Instructions

The following keys allow you to temporarily change the search options within the open window. The search results are immediately updated. The search options used when XCD starts can be changed in the configuration dialog [F12].

Keyboard Effect
number pad [*] the search word is extended automatically with *-Wildcards. (on/off)
number pad [/] only search the current drive (on/off)
number pad [0] error tolerance deactivated (on/off)
A Allow directory search on all drives
C bis Z Limit directory search to the selected drive

Function keys used in XCD.

Function key [F1] Help
Function key [F2] Update treeinfo
Function key [F3] Set selected directory as new starting directory for the next search. (*)
Function key [F4] Undo the effect of [F3] (*)
Function key [F5] Show directory history
Function key [F12] Configuration dialog with program settings is opened.

(Right-click in the XCD dialog box to open a menu of these function keys.)

(*) As long as no new search word is entered, all subdirectories of the starting directory are shown. Thus [F3] can show all the subdirectories of a directory and [F4] returns.

XCD Over A Network

XCD can also find directories over a network. The tree structure of directories shared in the network must have been scanned. If existing directories are not found, "treeinfo.net" is not up to date.

Enter on TC command line Effect
xcd /net or
xcd \\
Read in the directory structure of the network shares
xcd \\ <target_directory>
xcd /net <target_directory>
Changes to a directory in the network
xcd \\<computer> <target_directory> Changes to a directory on a certain network computer
xcd . <target_directory> Changes straight into a sublist of the active directory (as with local drives)



Configuration Dialog Box

Pressing F12 in the main window launches the configuration dialog box.

options

History settings:

Settings for the Treeinfo.wc:


Explanations concerning the error tolerance

With active tolerance: When searching for matching directories, XCD allows deviation from the search word for each directory. That means: How many characters must be exchanged/added/omitted for the search word to agree. The directories with the smallest deviation are then listed.

With the tolerance keys the tolerance threshold can be further increased (up to max. 50%). Directories that differ by more than half are not considered.

To disable error tolerance, simply set the threshold to 0. Thus only exact matches are found (with higher search speed).


Explanation concerning the exception list (in the Treeinfo options)

The directories listed here are abort conditions when reading the directory structure. All directories must be entered as "regular expressions" (RegExp) therefore the double backslashes in the list. All directories on a drive are read successively and compared with the list entries and matching directories are skipped.

When reading the directory structure, each directory path is in this form: x:\dir1\dir2

x:\dir1\dir2 (notice no backslash at the end.)

The entry: \\dir2$&xnbsp; matches the path ($ stands for line end)
the entry: \\dir2\\ doesn't match the path (It does match this path: x:\dir1\dir2\dir3 )

that means:

Further examples
d:.*\.bak$ = on drive D: no directories that end with ".BAK"