home *** CD-ROM | disk | FTP | other *** search
/ Bila Vrana / BILA_VRANA.iso / 005A / CDDBNG11.ZIP / CDD!.TXT < prev    next >
Text File  |  1995-08-23  |  2KB  |  72 lines

  1. CDD!  an improved change directory command
  2.  
  3. ┌──────────────────────┐
  4. │ CDD! C:\MySub\MySub2 │
  5. │ CDD! C:\MySub\       │
  6. │ CDD! C:MySub         │
  7. │ CDD! ..              │
  8. │ CDD! D:\             │
  9. │ CDD! D:              │
  10. │ CDD! \               │
  11. │ CDD!                 │
  12. │     ^watch the space │
  13. └──────────────────────┘
  14.  
  15. by Roedy Green
  16. Canadian Mind Products
  17. #601 - 1330 Burrard Street
  18. Vancouver, BC
  19. Canada  V6Z 2B8
  20. (604) 685-8412
  21.  
  22. This program is copyrighted but free.  The source and object
  23. code may be used for any purpose except military.  You are free
  24. to copy it, sell it, modify it, or cannibalize it.  You can take
  25. out the credits if you want.  The only restriction, backed up by
  26. Canadian Mind Products standard very nasty penalties is that you
  27. must make sure none of it is ever used for a military purpose.
  28.  
  29. Purpose
  30. =======
  31.  
  32. The CD command that comes with MS or PC DOS has three flaws:
  33. 1.  It does not set the ERRORLEVEL for Invalid directories.
  34. 2.  It fails when there is a trailing backslash on the name.
  35. 3.  You cannot hide its error messages with >NUL: redirection.
  36. 4.  It won't also change the drive for you in one step.
  37.  
  38. CDD! acts just like CD except that it fixes these four problems.
  39. CDD! is slower since it is must be loaded each time, whereas CD
  40. is internal to DOS.  It is similar to the 4DOS command CDD.
  41.  
  42. Samples of Use
  43. ==============
  44.  
  45. CDD! behaves just like the normal 4DOS CDD command except that it
  46. sets ERRORLEVEL to 1 if it fails because the directory requested
  47. does not exist.
  48.  
  49. CDD! C:\MYDIR\MYSUBDIR
  50. IF ERRORLEVEL 1 ECHO missing directory
  51.  
  52. CD   \MYDIR
  53. CDD! SUBDIR
  54. IF ERRORLEVEL 1 ECHO missing directory
  55.  
  56. CDD! \MYDIR\MYSUBDIR\
  57. IF ERRORLEVEL 1 ECHO missing directory
  58.  
  59. CDD! ..
  60. IF ERRORLEVEL 1 ECHO already at the root
  61.  
  62. CDD! D:\
  63. REM changes the current directory on D: to the root
  64.  
  65. CDD! D:
  66. REM displays the current directory on D:
  67.  
  68. CDD!
  69. REM displays the current directory.
  70.  
  71. -30-
  72.