CDD!  an improved change directory command

Ŀ
 CDD! C:\MySub\MySub2 
 CDD! C:\MySub\       
 CDD! C:MySub         
 CDD! ..              
 CDD! D:\             
 CDD! D:              
 CDD! \               
 CDD!                 
     ^watch the space 


by Roedy Green
Canadian Mind Products
POB 707 Quathiaski Cove
Quadra Island BC Canada
V0P 1N0
(250) 285-2954
Internet Roedy@Bix.Com

This program is copyrighted but free.  The source and object
code may be used for any purpose except military.  You are free
to copy it, sell it, modify it, or cannibalize it.  You can take
out the credits if you want.  The only restriction, backed up by
Canadian Mind Products standard very nasty penalties is that you
must make sure none of it is ever used for a military purpose.

Purpose
=======

The CD command that comes with MS or PC DOS has three flaws:
1.  It does not set the ERRORLEVEL for Invalid directories.
2.  It fails when there is a trailing backslash on the name.
3.  You cannot hide its error messages with >NUL: redirection.
4.  It won't also change the drive for you in one step.

CDD! acts just like CD except that it fixes these four problems.
CDD! is slower since it is must be loaded each time, whereas CD
is internal to DOS.  It is similar to the 4DOS command CDD.

Samples of Use
==============

CDD! behaves just like the normal 4DOS CDD command except that it
sets ERRORLEVEL to 1 if it fails because the directory requested
does not exist.

CDD! C:\MYDIR\MYSUBDIR
IF ERRORLEVEL 1 ECHO missing directory

CD   \MYDIR
CDD! SUBDIR
IF ERRORLEVEL 1 ECHO missing directory

CDD! \MYDIR\MYSUBDIR\
IF ERRORLEVEL 1 ECHO missing directory

CDD! ..
IF ERRORLEVEL 1 ECHO already at the root

CDD! D:\
REM changes the current directory on D: to the root

CDD! D:
REM displays the current directory on D:

CDD!
REM displays the current directory.

GETTING THE LATEST VERSION
**************************

Look for the latest version at my Web site:
  http://oberon.ark.com/~roedy

-30-
