Dec 282017
 
Change Directory a simpler way -- latest version of this one.
File JCD154.ZIP from The Programmer’s Corner in
Category File Managers
Change Directory a simpler way — latest version of this one.
File Name File Size Zip Size Zip Type
HISTORY.JCD 1265 552 deflated
JCD.COM 17854 10803 deflated
JCD.DOC 20001 6748 deflated
JCDSETUP.COM 18348 11477 deflated
QUICKDOC 2005 756 deflated

Download File JCD154.ZIP Here

Contents of the JCD.DOC file









Introduction -JCD V1.54


Imagine yourself entrenched in a computer project, a couple
of levels deep in a subdirectory tree. You decide you want to
move to the bottom of another directory tree so you type:

C:\TC\CODE> cd \com\dnld\game\arcade\larn

and you get the message "Invalid directory". Now frustration sets
in because not only are you still in the directory '\tc\code' but
you also have no idea where you made a mistake. This normally
prompts one of the best-known computer-related comments.

"The $&#%^* computer should have known what I meant."

Unfortunately, computers quite often do what you tell them
to do instead of what you want them to do. But you do have a
point. The computer should have been able to pick up a few clues
from what you typed to accomplish part of the task before
throwing your mistake back in your face. JCD was written to take
care of this particular situation.

Before we go any further, I should warn you that if you only
use the root directory or if you are a perfect typist, JCD will
probably not help you. However, for the rest of us, it can mean
the difference between finishing what you were doing and wasting
several minutes cursing a computer.

JCD was actually born from a situation similar to the one
mentioned above, although not quite as exaggerated. In the
example above, JCD would have changed directories to a path
matching as much of the requested path as possible. Next, instead
of the highly informative error message returned by DOS, JCD
gives you a subdirectory menu, allowing you to choose the one you
meant.

JCD soon expanded to cover many of the CHDIR errors that I
make on a regular basis. In addition, several features were added
to make JCD a useful utility in its own right instead of just a
correction to the CD command.


Usage

In general, JCD is used exactly the same as CD. For example,
if you wish to change from the root directory to your UTIL
directory you type:

C:\> jcd \util or C:\> jcd util

and JCD takes you to the proper directory. The only situation
where JCD does not behave exactly like CD is when the program is
used with no command line parameters. When no parameters are







given, CD types the name of the current directory on the screen.
JCD also types the name of the current directory; but, if there
are any subdirectories to choose from, JCD brings up a menu
allowing you to choose where to go next.


What does JCD do for me?

At this point you may be asking yourself the question above.
Then again, you may not. Oh well, I'm going to tell you anyway.
JCD does not have a bright, beautiful, helpful user interface.
The only thing that JCD does do is handle some of the problems
that occur with the use of one DOS command.

JCD handles simple typing errors.

JCD handles a wide variety of typing errors. For
instance, what if you type "jcd ,,". (NOTE to 4DOS users:
This particular case does not function properly under 4DOS.
This is due to a 4DOS bug which I have reported to Tom
Rawson, and he is looking for a solution.) I know and you
know that you want to go up one level in the directory tree.
JCD assumes that if you type a comma what you really meant
was a period. If you type a '/' instead of a '\', that's
okay; JCD knows what you mean there too. JCD also assumes
that a ';' is supposed to be a ':'.

JCD can recursively search a disk for a directory.

How many times have you typed "cd util" when you meant
"cd \util"? JCD will handle this situation with a recursive
search of the directory structure, if you allow it to. This
also handles the situation where you know the name of the
subdirectory that you want to go to, but you don't remember
what directory it is under. It can also match a set of
directories. For instance, a recursive search for "inc\sys"
will send you to "\tc\inc\sys" and skip "\bin\sys". For
those of us who sometimes manage to have two different
subdirectories with the same name, JCD allows you to
continue a recursive directory search if it has found the
wrong subdirectory. At least for now, JCD cannot go more
than fifteen levels deep.

JCD catches stray beginning '\'s .

Say you are in your 123 directory and wish to move to
the DATA subdirectory under 123 (or whatever). How many
times have you typed:

C:\123> cd \data

DOS tells you there is no such directory. Maybe you stare at
the screen in confusion for a few seconds. Then you notice
the '\' at the front of the directory name. JCD checks for



- 2 -







this error and asks you if you would like to move down
instead of going to the root.

JCD simplifies moving towards the root.

DOS uses two special directory names (. and ..) for the
purpose of changing directories. JCD extends this concept to
allow easier access to directories closer to the root. Where
.. means 'parent', ... now means grandparent (..\..), ....
means great-grandparent (..\..\..), and so on.This will be
especially helpful for people with deep directory trees.

JCD gracefully handles errors in path specification.

The main reason for the JCD program is the problem
mentioned in the introduction. JCD assumes if the first
portion of the path you typed is valid, you probably meant
to go at least that far. In fact, you will never again get
an "Invalid directory" error since at the very worst, you
can't misspell the root directory.

JCD allows movement to another drive.

If you want to move to a new directory on a different
drive, DOS requires two different commands. First, you must
change drives. Then, you can change to the directory you
want. With JCD, you can do both at the same time. If you are
on B drive and wish to go to the util directory on C you
type

B:\> jcd c:\util

and you are in c:\util in a single step. As mentioned above,
if you type "a;", JCD assumes that you meant "a:".

JCD combines all of the above features in one.

JCD also combines these features so that they may all
be used at one time. For instance:

C:\UTIL\> jcd d;.,.\bin\nv

will move you to d: drive, then to the grandparent of the
directory you were in on d. Next, it would move to the BIN
subdirectory and bring up a menu because you meant NU.

JCD handles "move across" typos.
If you try to move to another subdirectory in the same
parent directory as the one you are currently in, a very
simple typo becomes possible. If you type '..subdir' leaving
out the backslash. JCD assumes you meant for one to be after
the second period and moves you where you meant to go.

JCD allows you to toggle between two directories.



- 3 -







Have you ever found yourself moving back and forth
between two directories for any reason? JCD now allows you
to do this with a short command. No need to even remember
the whole path. By typing 'jcd - ' you may go back to the
last directory you used JCD from. For example,

C:\WP> jcd d:\123
D:\123> jcd -
C:\WP>

The '-' option allows you to return without all of that
typing.

(NOTE for the technically minded: This feat is handled by
the simple method of modifying JCD after you use it. When
JCD changes directories, it finds itself and modifies a
variable which stores the old directory. It also updates the
date. In case of error, (i.e. write-protection, file not
found, etc.) this feature is ignored.)


The Menu

The next major feature of JCD is the subdirectory menu. This
menu shows the first sixty-four subdirectories of the directory
you are now in (sorted alphabetically). You may choose one of
these subdirectories by using the UP, DOWN, HOME, and END keys to
move around and then strike ENTER. Pressing SPACE is the same as
pressing DOWN. You may also type a character, this will move the
highlight bar to the menu entry of the first subdirectory that
begins with this character. Pressing ENTER at this point will
choose. Pressing ESC will exit the menu, leaving you in the
directory you started in.

The first item on the menu is a "You are here" choice. This
choice allows you to stop where you are instead of continuing to
a subdirectory. In some earlier versions of JCD, you could end up
with a directory that you could not enter without two uses of
JCD.

Four other commands may be used from the menu. The first is
the LEFT arrow key. Pressing this key will move you up one level
and bring up a new menu. The RIGHT arrow key is the second
command. Pressing this key will move you to the subdirectory
highlighted on the menu and, if possible, bring up a menu
containing this directory's subdirectories. This allows you to
move down a directory tree when you cannot remember the spelling
of any of the different levels. Next is the PgUp key. PgUp moves
you to the current directory of the next higher disk (i.e. from
B: to C:). Unlike previous versions of JCD, the program reapplies
the path search specified on the command line to the new drive.
The last key is PgDn, which moves to the next lower disk and
otherwise performs as PgUp.




- 4 -







Before JCD puts a menu on the screen it tells you what
directory it is currently in. This is useful if the program has
moved partway down your designated path and can't decide where
else to go. Now you know where you are and can make a reasonable
guess about where to go next. The amount of time that JCD pauses
between displaying the current path and displaying the window is
controlled controlled by a value set by the JCDSETUP program
described below. The default setting is 500 which denotes a wait
of a half second.


Use of JCD in Batch Files

Even though JCD wasn't originally intended to be used inside
a batch file, (I had generally assumed that if you are using JCD
in a batch file, you won't be making any typos.) I realize that
someone may wish to use it this way. In order to make this more
convenient, I have added a few return values to JCD to allow a
batch file to know what is going on. These return values are as
follows:

0 Program terminated normally.
1 JCD took no action on a recursive disk search.
2 JCD took no action from the menu.
3 JCD took no action.
4 JCD was told to go to the root's parent.
9 When generating the menu, JCD encountered a memory
allocation error.

Since JCD is a relatively simple program, I believe that these
codes should handle all situations at this time.


The JCDSETUP Program
A new file has been added to the JCD program set. Its name
is JCDSETUP. The purpose of this program is to allow you to
customize some aspects of JCD. Only two features are modifiable
at this time; the menu colors and the pause before the menu. Both
of these features have been requested for some time and this
appears to be the most efficient means to accomplish it.

JCDSETUP is menu driven and allows the user to customize the
menu, frame, and highlight bar however he chooses. In addition,
the delay before the menu appears (in milliseconds) may also be
set. Lastly, the default settings for JCD may be restored at any
time.

WARNING for future reference: JCDSETUP is tailored to an
specific version of JCD and has been designed to test to make
sure it is being used on the correct version. It is probably
possible to bypass this protection. BE WARNED this will probably
mess up JCD. I realize that this message is obvious; however you
can never be to careful.




- 5 -







Commonly Asked Questions

Here are a few commonly asked questions about JCD.

WHY should I use this utility?

I wrote JCD to solve a problem with the way DOS works.
There are many other programs that do basically the same
job and more. The main problem I have found with using
these programs has been how much time is spent loading
information I will never use in the process of changing
directories.

Why don't you get rid of the "Current Directory is ..." message.
That message actually serves a purpose relating to the
original reason I wrote JCD. If you make a mistake typing a
long path name, JCD is capable of moving you partway down
the path. It then brings up a menu. The message is there
specifically to tell you how far along JCD got before the
problem arose.

There has been one major misconception about JCD; and I
think now is the time to clear it up. JCD is not supposed to be a
fancy, multipupose utility (although it seems to be heading in
that direction.) JCD was written to replace CD in everyday use.
That's all JCD is, an intelligent CD. The only time that new
features will be added to JCD is when they do not conflict with
the original purpose. This purpose can be stated very simply: JCD
handles the mistakes I make when using CD.

Shareware Information and Disclaimer


This program (JCD) is not free or public domain software.
The program is distributed under the SHAREWARE or "try it before
you buy it" concept of software. Feel free to copy this program
and give it to friends and coworkers, provided you follow two
simple rules.

I. Please pass along the original package without
modifications and including all documentation.

II. No fee should be charged for the program. This also
means that the program should not be packaged with another
program or computer system for sale. Users' groups and
software libraries are allowed to charge a small fee not to
exceed $5 to cover the cost of the disk and copying
services.

If you find JCD to be a useful program that makes your life
easier, please send $10 to the address shown below. Please
include your full name, address, version number, where you got
the program, and any bugs you may have found. This will allow me
to keep my records up to date. This registration will entitle the



- 6 -







user to a copy of the latest version of the program, notification
of future updates, and information about possible new programs as
they become available.

G. Wade Johnson
7510 Brompton #664
Houston, Texas 77025

Bugs may also be reported through electronic mail.

CompuServe 72470,2776

The author hereby disclaims all warranties with regard to
fitness for a particular purpose. The author may only be held
liable for the replacement of a defective copy of the program and
its documentation. This liability does not extend to any other
damages including but not limited to loss of profit or other
incidental or consequential damages.

Copyright Notice and Acknowledgements

JCD and its accompanying documentation are Copyrighted by G.
Wade Johnson 1989 all rights reserved. I would also like to
acknowledge the help of all of the friends and coworkers who
assisted in the beta testing of this software. My beta testers
include Cass Couvillion, Youseph Yazdi, Ed Jackson, Ignacio
Cespedes, Dave Shattuck, and Debra Campbell, plus others who
tried JCD because it was on a computer. In addition, I'd like to
thank some people who sent me some good ideas which helped to
make JCD a better product. Henry Schofield Noble suggested some
new features for the past two versions and one or two more that I
am still thinking about. Thanks also to Tom Clark, who suggested
some more possible CD errors and errorlevel use.
























- 7 -


 December 28, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)