Led's Change Directory (LCD) v4.0
Copyright (c) 1991 by Keith Ledbetter.
All rights reserved.
v4.0b 8/25/91 o A bug was fixed where "LCD /M" would return with
"directory /M isn't in the database" -- LCD now
displays the current directory like it should in
o A few people didn't like the fact that since the
new Speed-Search option was added they could no
longer go to the first entry of drive D:, for
example, by hitting the "D" key. This can now once
again be done by pressing ALT plus the drive letter.
In other words, ALT-E will take you to the first
entry in the list on drive E:, ALT-G to drive G:, etc.
v4.0a 8/17/91 o LCD's pop-up selection box is now twice as big as
o LCD now has a "speed search" option in the selection
screen. Any keypresses will be filtered into this
speed-search field, and will immediately filter out
non-matching directory names. The speed search does
its matching from the START of the directory name by
default. You can toggle this on and off by pressing
the '*' key. Pressing the '*' key turns on "match
anywhere" logic. For example, if you have directories
named UTILS and BUTTONS, a speed search entry of "ut"
would only show the UTILS directory. Pressing "*"
would show both the UTILS and the BUTTONS directories.
o There is now Microsoft-compatible mouse support in
the pop-up selection box. You must specify the "/M"
parameter AT THE END of the command line for mouse
support to be turned on. You must also have loaded
your mouse driver before invoking LCD. If you are
currently ALIASing CD with either 4DOS or DOS 5's
DOSKEY, just do this:
4DOS: alias cd `lcd %1 /M`
DOSKEY: doskey cd=lcd $1 /M
When mouse support is active, the following screen
areas are "hot areas":
ÚÄ aborts the program (or right mouse button)
³ ÚÄ clicking on the top bar "pages up"
ÕÍ[þ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍµ ...... .... ..... ÆÑÍ¸
clicking on a ³ ............... ³^³- line up
name changes ÄÅÄÄ ........... ³°³
to that dir ³ ................... ³°³
³ ³v³- line down
³ ......³. .... .. . . . . . .... ... .... ³
³ ......³. .... .. . . . . . .... ... .... ³
ÀÄ clicking on this bar "pages down"
o LCD can now rename subdirectories and update the
database immediately. This is done with the "LCD REN"
command. You can not specify a path name in the new
filename. For example, if you're not in the current
directory for the rename, don't do this:
LCD ren c:\path\olddir c:\path\newdir
instead, simply do:
LCD ren c:\path\olddir newdir
For those of you doing aliases, you can do:
4DOS: alias rendir `LCD REN %1 %2`
DOSKEY: doskey rendir=LCD REN $1 $2
o LCD now sees hidden directories when doing a scan.
o You can now do "LCD ..." as a shortcut to go up two
directories, or "LCD ...." to go up three directories.
o An even easier shortcut is the "-n" parameter, which
moves you up "n" directory levels. For example, if you
are currently in the C:\PCPLUS\DOWNLOAD\NEW\TEMP
directory, "LCD -3" would move you to the C:\PCPLUS dir.
o The LCD_COLORS environment variable can now either be
specified by NUMBER or by NAME. For example, you can
SET LCD_COLORS=blue white yellow lightgray blue red
To get a complete listing of the available color names,
just do an "LCD /?" command.
o Two new "errorlevel" conditions:
10 : unable to rename the specified directory.
11 : a bad parameter was specified.
v3.1a 5/05/91 o Sorry for the back-to-back releases, but 43 and 50
line modes on EGA/VGA monitors was something that
I'd promised for release in v3.0a. Unfortunately,
it completely slipped my mind. Of course, only a
few hours after 3.0's release, quite a few people
reminded me of my intentions. This version will
actually support any number of lines as long as
the BIOS reports it correctly.
v3.0a 5/03/91 o From an operational point of view, it will look to
you like LCD has changed very little. In fact, the
entire program has been totally rewritten from the
ground up. This was facilitated by one problem --
people with large drives (normally on Networks)
couldn't scan all of their drives because earlier
versions of LCD would allow only a 22K database size.
In normal use, this would usually average out to around
a maximum of 1,100 directory entries that could be
stored in the database. I say "usually" because the
way the old (v2.x) LCD stored its database was
Version 3.x of LCD now uses a totally different,
fixed-entry-size file format that can store up to
4,000 directory entries in the database.
o Because of the new database format, you must re-scan
after installing v3.0a.
o Since LCD is being used by many people as a total
replacement for DOS's CD, RD, and MD commands (through
aliasing), I changed the program to simply return the
current path name if you invoke LCD with no command
line parameters (just like DOS's CD command does).
If you want to see the help screen, you must explicitly
do an "LCD /?" (or "LCD /HELP") command.
o Because of the new database format, LCD can no longer
store a child directory in the database if its parent
isn't there. In other words, if you do this (with no
'aliases' on MD):
LCD md C:\Junk\Junk2
LCD will create the directory "Junk2", but it will tell
you that it couldn't store the name in the database
because its parent wasn't found.
o If you have more than 4,000 directories, LCD will
still abort as always, but it WILL save the directory
database up to that point (ie: your first 4000 dirs).
o The LCD environment variable now specifies the entire
filename of where you want the index to be. If you
don't have an LCD environment variable, the default is
"C:\LCD.IDX" as always. But, if you want to move it,
you can do:
SET LCD=D:\Utils\SubDirs.Idx (or whatever)
o I have "reversed" the /SCAN logic so that there are now
/SCAN - does a normal scan, INCLUDING
directories with extensions
/QSCAN - does a v2.x-type scan, which ignores
directories with extensions
I made this change because about 95% of my tech support
calls on LCD are this: "it's not finding my directories
with extensions on them!" (about 95% of my SST calls are
for the same reason).
o You can now change the colors of the pop-up display box.
You do this by setting an environment variable named
"LCD_COLORS". Its format:
Set LCD_Colors = background
(all on one line, of course). The colors are specified
by number, where the colors are:
0 BLACK 8 DARKGRAY
1 BLUE 9 LIGHTBLUE
2 GREEN 10 LIGHTGREEN
3 CYAN 11 LIGHTCYAN
4 RED 12 LIGHTRED
5 MAGENTA 13 LIGHTMAGENTA
6 BROWN 14 YELLOW
7 LIGHTGRAY 15 WHITE
As an example:
Set LCD_Colors = 7 0 14 1 15 3
would give you a LIGHTGRAY box, with BLACK text, YELLOW
highlighting, BLUE selection bar with WHITE text, and a
CYAN thumbtack (on the scroll bar).
o If you use LCD on a monochrome system, just do this:
Set LCD_Colors = Mono
and LCD will select a predefined monochrome color set.
o You can now abort the /SCAN process with the ESCape key.
o Two new "errorlevel" conditions:
8 : there wasn't enough memory to allocate for
the directory database.
9 : either the "LCD" or "LCD_COLORS" environment
variable is incorrectly formatted.
v2.1 3/07/91 o LCD now returns more detailed ERRORLEVEL conditions,
which had been asked for by quite a few users who
invoke LCD from batch files. The errorlevels are as
0 : LCD was successful
1 : LCD was successful; ignoring floppy drive
2 : unable to change to the drive or directory
3 : drive scan failed
4 : database error (can't read/write/create)
5 : can't create/remove specified directory
6 : no command line parameters were specified
7 : user aborted LCD with the ESC key
There is a batch file included (LCDTEST.BAT) that
shows how you can use these values in your batch files.
v2.0 12/01/90 o Simply an oversight: v1.4 would update the directory
database if you used LCD to create a directory on
drive A: or B:. LCD no longer updates the directory
database if you use it to make or remove a directory
on these drives (this was probably only apparent to
those of us who "alias" MD and RD to use LCD.EXE).
v1.5 - v1.9 o These version numbers were skipped.
v1.4 11/24/90 o LCD can now be used as a TOTAL replacement for DOS's
"cd", "rd", and "md" commands. LCD will now try to
immediately change to the directory name that you
specify; if that fails, only then will it go to the
directory database to search for fuzzy matches. In
other words, if you have the following two directories
and you are currently in the C:\PROCOMM directory, then
"LCD download" will change you to the \PROCOMM\DOWNLOAD
directory without invoking the dialog box.
o LCD can now create and delete directories itself, with
immediate updating of the directory database at the
same time. The syntax is:
LCD md directory_name
LCD rd directory_name
These commands are most useful when used with an
aliasing shell like CED or 4DOS. Since I use 4DOS,
I have aliases set up as follows:
alias cd `lcd %1`
alias md `lcd md %1`
alias rd `lcd rd %1`
o You can now set an environment variable named LCD to
the drive that you'd like your LCD.IDX file stored on
(for example, SET LCD=D tells LCD to maintain your
database in the file D:\LCD.IDX). If there is no LCD
environment variable, the file will be kept on drive
C: just like before.
o When in the scrollable dialog box, you now have use of
the full movement keys (PgUp, PgDn, Home, End, arrow
keys). You can also press C through Z to immediately
go to that drive's directories. This is most useful
when doing "LCD *" to see all names in the database.
v1.3 10/15/90 o Fixed a bug where LCD would get confused if you had a
one-letter directory name, and that letter also occurred
in its parent directory (ie: "c:\aRc\R").
o Of course, the above change can be a problem if (a) you
have a one-character directory name, as in R, and you
also have a lot of other directories that begin with R.
So, I have changed LCD so that it understands an asterisk
('*') as a wildcard character. Some examples are the
easiest way to explain:
LCD r* : find all paths that BEGIN with the
LCD *on : find all paths that have the word
"on" in them.
LCD * : show me all paths in the database.
o A few people wanted to be able to change to either
(a) the parent directory, or (b) the root directory
while still using LCD. LCD will now allow this,
so you can do:
LCD .. ;go up one level
LCD \ ;go to the root.
v1.2 10/11/90 o A lot of people (in fact, everyone who has contacted
me) have suggested that LCD should give the highest
priority to the first positions of the pathname
specified. In other words, if you have the following
two paths on your hard drive:
then "LCD TEST" should change to the \testing\
directory immediately. v1.2 now does this.
o Overall, the matching logic in v1.2 has been greatly
improved. It now does a much better job of figuring
out what you really wanted it to do. But, it will
probably help if you know exactly how LCD does it's
searching. In a nutshell, here is what LCD does:
1. Look for an EXACT match on the directory name
specified. If more than one found, display
the dialog box. If none found, go to step 2.
2. Look for a "fuzzy" match on the name. By LCD's
standards, a fuzzy match is the name you
specified followed by any extra data. For
example, if you specify "LCD data", then all
of the following would match:
If more than one match found, display the
dialog box. If none found, go to step 3.
3. At this point, LCD just looks for the partial
string anywhere in a path name, preceeded or
followed by any characters.
o Since so very few people use extensions on their
directory names, I changed the logic to once again
use "*." for directory searches instead of "*.*".
This speeds the /SCAN function up by about 50%. If
you have directory names with extensions on them,
then you must use the /ESCAN switch instead of /SCAN.
Operation is the same, except that LCD will then use
the slower scanning method.
v1.1 10/04/90 o Since the .IDX file is stored a little differently,
you MUST do a /SCAN before using LCD v1.1 (this is
for those of you currently using v1.0).
o LCD is now much smarter on "fuzzy" directory names.
For example, "lcd pcp" will now change you to your
"d:\pcplus" directory always, even if you have
"pcplus\downloads" and "pcplus\uploads", etc.
o When LCD can't figure out which directory you really
want, it will now pop up a scrollable dialog box with
all of the matches found in it. You simply move the
highlight bar to the directory that you want, and then
A lot of people requested something like this, and I
wasn't sure how I was going to like it at first. But,
after playing with it for a couple of days, I think it
was a good idea. It's much more logical than LCD trying
to "cycle" through all of the matches one invocation at
o A few people also complained about LCD not seeing
directories that have an extension on them
(ie: MYDATA.DIR). I still can't sneak by anybody on
this issue! So, LCD v1.1 now sees directories with
extensions; you will notice that the /SCAN function
takes around twice as long to run now.