home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / pcmagazi / 1992 / 14 / pdwrap.bat < prev    next >
DOS Batch File  |  1992-01-16  |  549b  |  21 lines

  1. @ECHO OFF
  2. IF '%1'=='' GOTO Syntax
  3. SET theDir=%1
  4. FOR %%v IN (/%theDir%) DO SET theDir=%%v
  5. FOR %%v IN (/%theDir%) DO SET theDir=%%v
  6. FOR %%v IN (/%theDir%) DO SET theDir=%%v
  7. IF '%theDir%'=='.' GOTO BadChoice
  8. IF '%theDir%'=='\' GOTO BadChoice
  9. IF NOT EXIST %1\NUL GOTO NoDirectory
  10. PD %1
  11. :BadChoice
  12. ECHO You must not attempt to prune the current 
  13. ECHO directory, its parent, or any root directory!
  14. GOTO End
  15. :NoDirectory
  16. ECHO Directory "%1" does not exist
  17. GOTO End
  18. :Syntax
  19. ECHO SYNTAX : PDWRRAP [[drive:\]path\]dirname
  20. :End
  21. SET theDir=