home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Bila Vrana
/
BILA_VRANA.iso
/
005A
/
CDDBNG11.ZIP
/
CDD!.TXT
< prev
next >
Wrap
Text File
|
1995-08-23
|
2KB
|
72 lines
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
#601 - 1330 Burrard Street
Vancouver, BC
Canada V6Z 2B8
(604) 685-8412
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.
-30-