home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 June
/
SIMTEL_0692.cdr
/
msdos
/
zip
/
catoz.arc
/
CATOZ.BAT
next >
Wrap
DOS Batch File
|
1989-06-18
|
3KB
|
131 lines
echo off
echo
echo Convert Arc TO Zip procedure. 6-18-1989 13:14:12
REM by Alex Janssen
REM GENIE a.janssen1
if %1z==z goto USAGE
if not exist %1.ARC goto NOTEXIST
if exist %1.ZIP goto ZIPEXIST
goto PROCESS
:NOTEXIST
echo File "%1.ARC" not found.
goto EXIT1
:USAGE
echo
echo USAGE IS catoz [path\]filename
echo
echo [path\] is optional and is only necessary if the file to be converted
echo is not on the current default directory.
echo
echo DO NOT include the file name extension, .ARC for the filename.
echo
echo If you do not have the program PKUNPAK by PKware you will have to edit
echo this batch file and change the pkunpak command to the appropriate command
echo to unpack your compressed file libraries to the temporary directory created
echo for the unpacked files.
echo
goto EXIT1
:ZIPEXIST
echo "%1.ZIP" already exists.
goto EXIT1
:PROCESS The conversion is performed here.
REM Make a temporary directory for the unarchived files to
REM reside in.
md $$catoz$
REM Unpack the compressed files into the new directory and
REM test for an error. Alternate command for unpacking with
REM SEA's ARC. Delete the pkunpak ... line and remove the
REM REM in front of the arc ... line.
REM arc %1 $$catoz$\*.*
pkunpak %1 $$catoz$
if errorlevel 1 goto EXIT2
REM Recompress the files into the new ZIP format and delete
REM uncompressed copies. /ex parameter is available only with
REM version 0.92 and newer of PKZIP.
pkzip /om /ex2 %1 $$catoz$\*.*
if errorlevel 16 goto err16
if errorlevel 15 goto err15
if errorlevel 14 goto err14
if errorlevel 13 goto err13
if errorlevel 12 goto err12
if errorlevel 4 goto err4-11
if errorlevel 2 goto err2-3
if errorlevel 1 goto err1
REM Clean up.
REM Remove the temporary directory if all went well.
rd $$catoz$
REM Display both ARC and ZIP versions for the sake of
REM comparison.
dir %1.*
REM Test for existance of new ZIP file and display error
REM message if not there.
if not exist %1.ZIP goto EXIT3
REM Delete the old ARC version only if the new ZIP version
REM was created.
del %1.ARC
echo Conversion of %1.ARC to %1.ZIP complete.
goto EXIT1
REM PKZIP returned error code translation.
:err1
echo Bad file name or file specification.
goto EXIT2
:err2-3
echo Error in ZIP file.
goto EXIT2
:err4-11
echo Insufficient Memory.
goto EXIT2
:err12
echo No files were found to add to the ZIP file,
echo or no files were specified for deletion.
goto EXIT2
:err13
echo File not found. The specified ZIP file
echo or list file was not found.
goto EXIT2
:err14
echo Disk full.
goto EXIT2
:err15
echo ZIP file is read-only and can not be modified.
goto EXIT2
:err16
echo Bad or illegal parameters specified.
goto EXIT2
:EXIT3
echo
echo The new ZIP file was not created.
:EXIT2
echo E R R O R O C C U R R E D
echo The next key press will exit this batch procedure.
pause
:EXIT1