CD!  an improved change directory command

Ŀ
 CD! C:\MySub\MySub2 
 CD! C:\MySub\       
 CD! C:MySub         
 CD! ..              
 CD! D:\             
 CD! D:              
 CD! \               
 CD!                 
    ^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.


CD! acts just like CD except that it fixes these three problems.
CD! is slower since it is must be loaded each time, whereas CD
is internal to DOS.

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

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

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

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

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

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

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

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

CD!
REM displays the current directory.

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

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

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

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


Rem -30-
