@echo off
rem *** CLOSE.BAT is creating a PKZIP archive of the PERCH case.
rem *** The [name].cal file is excluded (it can be generated any time).
rem *** Use OPEN.BAT to re-open the case.
if "%1"=="" goto USAGE
if exist %1.cal del %1.cal
PKZIP.EXE -u %1.zip %1.*
if not exist %1.ZIP goto ERROR
echo Case '%1' archived as '%1.ZIP', use 'OPEN %1' to reopen.
choice /c:dk Delete or keep the uncompressed case? Delete,Keep? 
If errorlevel 2 Goto END
if exist %1.inf del %1.inf
if exist %1.txt del %1.txt
if exist %1.obs del %1.obs
if exist %1.dat del %1.dat
if exist %1.pms del %1.pms
if exist %1.sav del %1.sav
if exist %1.out del %1.out
if exist %1.top del %1.top
if exist %1.par del %1.par
if exist %1.his del %1.his
if exist %1.doc del %1.doc
if exist %1.asc del %1.asc
goto END
:USAGE
echo USAGE: CLOSE CASENAME
goto END
:ERROR
echo ERROR: Can't create '%1.ZIP'!
echo However you can use 'OPEN %1' to reopen the case.
:END
