home *** CD-ROM | disk | FTP | other *** search
- echo off
- rem
- rem Do not distribute ARC2ZIP.BAT separately from the rest of the package
- rem
-
- rem If you get an "Out of environment space" message, increase your
- rem environment space by using shell configuration in config.sys:
- rem Example: shell=c:\bin\command.com /e:1024 /p
-
- echo.
- echo ┌───────────────────────────────────────────────────────────────┐
- echo │ Convert and datestamp a single .arc to .zip file with comment │
- echo │ By Prof. Timo Salmi, ts@chyde.uwasa.fi, Sat 15-Jun-1991 │
- echo └───────────────────────────────────────────────────────────────┘
- if not "%1"=="" goto _continue
- echo.
- echo Usage: ARC2ZIP PackageName [/r(eplace the old .arc with the new .zip)]
- echo Use no drive name! No extension!
- echo ┌───────────────┐
- echo │ NO WILDCARDS! │
- echo └───────────────┘
- echo.
- echo When using for the first time:
- echo 1) Copy pkunpak.exe and pkzip.exe to a:\ (not provided)
- echo 2) Make a new directory a:\zip for converted files
- echo 3) Edit your own zip-file comment to a:\comment.txt (not provided)
- echo 4) If you do not have a ramdisk on r:\ alter line a:\pkzip -br:\ «-- ...
- echo 5) If you use a harddisk, edit the paths in ARC2ZIP.BAT as appropriate
- echo.
- echo Usually:
- echo Put the .arc file diskette in drive b:\
- echo Put the ARC2ZIP.BAT diskette in drive a:\
- echo And run normally
- goto _out
-
- :_continue
- rem Do the necessary programs, the comment file, and zip directory exist
- if not exist a:\pkzip.exe goto _err1
- if not exist a:\pkunpak.exe goto _err2
- if not exist a:\comment.txt goto _err3
- if not exist a:\zip\nul goto _err8
-
- rem Build the names for source .arc and target .zip files
- set _filea=b:\%1.arc
- set _filez=a:\zip\%1.zip
- if not exist %_filea% goto _err4
- if exist %_filez% goto _err5
- if not exist a:\tmp$$$\nul md a:\tmp$$$
- if exist a:\tmp$$$\*.* goto _err9
-
- rem Test archive integrity
- a:\pkunpak -t %_filea%
- if errorlevel==1 goto _err10
-
- rem Convert, use the date of the latest file, not the current date
- a:\pkunpak %_filea% a:\tmp$$$
- a:\pkzip -a %_filez% a:\comment.txt
- a:\pkzip -z %_filez% < a:\comment.txt
- a:\pkzip -d %_filez% comment.txt
- a:\pkzip -br:\ -u -m -o %_filez% a:\tmp$$$\*.*
- a:\pkzip -v %_filez%
- rd a:\tmp$$$
-
- rem State of the /r switch for replacing the old .arc file
- if "%2"=="/r" goto _replace
- if "%2"=="/R" goto _replace
- goto _out
-
- rem Replace the old .arc file with the new .zip file
- :_replace
- echo To replace %_filea% with %_filez% press any key
- echo To cancel, use the Break key now
- pause >nul
- if not exist %_filez% goto _err6
- if exist %_filea% del %_filea%
- if exist %_filea% goto _err7
- copy %_filez% b:\
- del %_filez%
- dir b:\%1.zip
- goto _out
-
- :_err1
- Echo File a:\pkzip.exe not found
- goto _out
-
- :_err2
- Echo File a:\pkunpak.exe not found
- goto _out
-
- :_err3
- Echo File a:\comment.txt not found
- goto _out
-
- :_err4
- Echo File %_filea% not found
- echo.
- echo Usage: ARC2ZIP PackageName [/r(eplace the old .arc with the new .zip)]
- echo Use no drive name! No extension!
- echo ┌───────────────┐
- echo │ NO WILDCARDS! │
- echo └───────────────┘
- goto _out
-
- :_err5
- Echo File %_filez% already exists
- goto _out
-
- :_err6
- Echo ARC2ZIP aborted: File %_filez% not found
- goto _out
-
- :_err7
- Echo ARC2ZIP aborted: Disk or file %_filea% is readonly
- goto _out
-
- :_err8
- Echo Error: Directory a:\zip does not exist
- goto _out
-
- :_err9
- Echo Error: Directory a:\tmp$$$ is not empty
- goto _out
-
- :_err10
- Echo ARC2ZIP aborted: Error in %_filea%
- goto _out
-
- :_out
- set _filea=
- set _filez=
- echo on
-