:FILE NAME      CLEANUP.CMD
:PURPOSE        Frees up disk space by deleting unwanted files
:COPYRIGHT      Richard W. Adams, 1993
:SYNTAX         CLEANUP [extension ...]
:REMARKS        Requires the GLOBALLY program, available from the author
:------------------------------------------------------------------------------
@ECHO OFF
CLS
CD \
:------------------------------------------------------------------------------
:See if help was requested
IF NOT "%1"=="?" GOTO START
ECHO This procedure cleans up the default drive by deleting unwanted files.  
ECHO You must have the utility program GLOBALLY.COM to run it.  Syntax:
ECHO ÿ
ECHO                    CLEANUP [extension ...]
ECHO ÿ
ECHO If you specify the optional extensions (up to 9), all files with those
ECHO extensions will be deleted.  If you list no extensions, the default is to
ECHO delete all files with extensions of BAK, CHK, TMP, &*, #*, and $*.
GOTO END
:------------------------------------------------------------------------------
:START
:See if operator specified extensions to delete
ECHO This procedure cleans up the default drive by deleting unwanted files.  You
ECHO must have the utility program GLOBALLY.COM to run it.  Files with the 
ECHO following extensions will be deleted: 
IF "%1"=="" GOTO NONE
ECHO ÿ
ECHO %1   %2   %3   %4   %5   %6   %7   %8   %9 
ECHO ÿ
PAUSE
GLOBALLY FOR %%F IN (*.%1 *.%2 *.%3 *.%4 *.%5 *.%6 *.%7 *.%8 *.%9) DO DEL %%F
GOTO DONE
:------------------------------------------------------------------------------
:NONE
ECHO ÿ
ECHO   BAK   CHK   TMP   &*   #*   $*
ECHO ÿ
ECHO These are the default settings.  If you want to specify different extensions
ECHO to delete, press Ctrl-Break and enter CLEANUP [extension ...].  Otherwise,
PAUSE
GLOBALLY FOR %%F IN (*.BAK   *.CHK   *.TMP   *.&*   *.#*   *.$*) DO DEL %%F
:------------------------------------------------------------------------------
:DONE
CLS
CHKDSK /F
:------------------------------------------------------------------------------
:END

