home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / PMCARD.ZIP / DIRDEL.BAT < prev    next >
DOS Batch File  |  1989-09-22  |  999b  |  34 lines

  1. @ECHO OFF
  2. IF "%1"=="" GOTO NoParam
  3. ECHO The following files will be deleted:
  4. DIR/W %1
  5. ECHO .
  6. ECHO Press Ctrl-C to abort, or
  7. PAUSE
  8. ERASE %1
  9. REM ********** NEW lines begin here **********
  10. ECHO Deleted "%1" -- now checking results . . .
  11. IF NOT EXIST %1 THEN GOTO noReadOnlys
  12. REM To create ^G in the next line, hold Ctrl and press G.
  13. ECHO 
  14. ECHO At least one file matching "%1" was a Read-Only file
  15. ECHO and hence was not deleted by the "DEL %1" command.
  16. :noReadOnlys
  17. DIR %1 | find "bytes free" > XXXXXXXX.TMP
  18. COPY XXXXXXXX.TMP YYYYYYYY.TMP > NUL
  19. DEL XXXXXXXX.TMP
  20. IF NOT EXIST YYYYYYYY.TMP GOTO end
  21. DEL YYYYYYYY.TMP
  22. REM To create ^G in the next line, hold Ctrl and press G.
  23. ECHO 
  24. ECHO DIR showed you some files matching "%1" that DEL did not
  25. ECHO delete.  Press a key to see files matching "%1".
  26. PAUSE > NUL
  27. DIR /W %1
  28. REM ********** NEW lines end here **********
  29. GOTO End
  30. :NoParam
  31. REM This is the message the internal DEL gives!
  32. ECHO Invalid number of parameters
  33. :End
  34.