home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / GLOBO1.ZIP / CLEANUP.CMD next >
OS/2 REXX Batch file  |  1991-06-21  |  2KB  |  65 lines

  1. :FILE NAME  CLEANUP.CMD
  2. :PURPOSE    Frees up disk space by deleting unwanted files
  3. :AUTHOR     Richard W. Adams, ASP
  4. :COPYRIGHT  1991 by author
  5. :SYNTAX     CLEANUP [extension ...]
  6. :REQUIRES   OS/2 and the program Globally
  7. :----------------------------------------
  8. @ECHO OFF
  9. CLS
  10. ECHO Cleanup, (C) 1991 by Richard W. Adams
  11. ECHO  
  12. :-------------------------
  13. :Was help requested ?
  14. IF NOT "%1"=="?" GOTO START
  15. ECHO This procedure deletes unwanted files on the default drive.  You must have
  16. ECHO the utility program Globally to run it.  Syntax:
  17. ECHO  
  18. ECHO                    CLEANUP [extension ...]
  19. ECHO  
  20. ECHO If you specify the optional extensions (up to 9), all files with those
  21. ECHO extensions will be deleted.  If you list no extensions, the default is to
  22. ECHO delete all files with extensions of BAK, CHK and TMP.
  23. ECHO  
  24. GOTO END
  25. :-------------------------
  26. :START
  27. :See if operator specified extensions to delete
  28. ECHO This procedure deletes unwanted files on the default drive.  You must have
  29. ECHO the utility program Globally to run it.  Files with the following extensions
  30. ECHO will be deleted: 
  31. IF "%1"=="" GOTO NONE
  32. ECHO  
  33. ECHO %1   %2   %3   %4   %5   %6   %7   %8   %9 
  34. ECHO  
  35. ECHO NOTE:  Cleanup will use the following command interpeter file:  %COMSPEC%.
  36. ECHO The procedure will go much faster if the command interpreter is on a RAM 
  37. ECHO disk.  If %COMSPEC% is not on a RAM disk, you may want to press Ctrl-Break
  38. ECHO and reset your COMSPEC variable to point to a version on a RAM disk.
  39. ECHO Otherwise,
  40. PAUSE
  41. GLOBALLY FOR %%F IN (*.%1 *.%2 *.%3 *.%4 *.%5 *.%6 *.%7 *.%8 *.%9) DO DEL %%F
  42. GOTO DONE
  43. :-------------------------
  44. :NONE
  45. ECHO  
  46. ECHO   BAK   CHK   TMP
  47. ECHO  
  48. ECHO These are the default settings.  If you want to specify different extensions
  49. ECHO to delete, press Ctrl-Break and enter CLEANUP [extension ...].
  50. ECHO  
  51. ECHO NOTE:  Cleanup will use the following command interpeter file:  %COMSPEC%.
  52. ECHO The procedure will go much faster if the command interpreter is on a RAM 
  53. ECHO disk.  If %COMSPEC% is not on a RAM disk, you may want to press Ctrl-Break
  54. ECHO and reset your COMSPEC variable to point to a version on a RAM disk.
  55. ECHO Otherwise,
  56. PAUSE
  57. GLOBALLY FOR %%F IN (*.BAK   *.CHK   *.TMP) DO DEL %%F
  58. :-------------------------
  59. :DONE
  60. CLS
  61. CHKDSK
  62. :-------------------------
  63. :END
  64.  
  65.