home *** CD-ROM | disk | FTP | other *** search
- @Echo off
- Rem Zip2zip.Bat Ver 3.0ß -By Robert Boone-
- Rem To Convert (Re-zip) all files within a .ZIP fileset to
- Rem PKZIP 2.04g max compression. (*IS* Version Specific To Function)
- Rem Supports D:\PATH\ and Runs From: 1. In path, 2. From It's SubDir.
- Rem Does Support WildCard ZipName. Does NOT support mult-filenames on cmd line.
-
- IF "%1"=="" GoTo Syntax
- IF "%2"=="" GoTo Syntax
- IF Exist ZIP2-FSZ. Del ZIP2-FSZ. >Nul
- IF Exist ZIP2-FSZ.$$$ Del ZIP2-FSZ.$$$ >Nul
- IF Exist EV0.FLG Del EV0.FLG >Nul
- IF Exist TEMP_$$$.BAT Del TEMP_$$$.BAT >Nul
-
- IF "%ZXPERT%"=="ON" GoTo EV_OK
- IF "%ZXPERT%"=="on" GoTo EV_OK
-
- Call Zip2ZipA.Bat
- IF Exist EV0.FLG GoTo OUT_ENV
-
- :EV_OK
- Set EVCHK40=
- Set EVCHK30=
-
- Rem v----When/if newer version, modify this line.
- PKZIP -L | Find "Version 2.04g" >ZIP2-FSZ.
- Call ZIP2-FSZ.BAT
- IF "%FSIZE%"=="" GoTo MajorError
- IF "%FSIZE%"=="0" GoTo Wrong_PK
-
- Echo PKZIP 2.04g Found OK.
- Set CNZL=
- IF Not Exist %1%2.ZIP GoTo OOPS
-
- Set SAFETY=0Ff
- Call ZIP2-SDE.BAT %1 Z_B
- IF "%FSIZE%"=="" GoTo MajorError
- IF NOT "%FSIZE%"=="0" GoTo REQ_SD
-
- :NO_Z_B
- IF Exist %1ZIP2ZIP.CVT DEL %1ZIP2ZIP.CVT >Nul
- Echo. >>%1ZIP2ZIP.LOG
- Echo Starting Session at %ZTIME% on %ZDATE% %OS% >>%1ZIP2ZIP.LOG
- Dir %1%2.ZIP | Find "file(s)" >>%1ZIP2ZIP.LOG
-
- For %%f IN (ZTIME ZDATE FZIZE) DO Set %%f=
- Echo Zip2Zip.Bat (Master Executing)
-
- Rem ========== Starting ZIP2ZIP Conversion(s) ===========
- For %%f in (%1%2.ZIP) DO Call Zip2zipB.Bat %1 %%f
- Rem ========== Ending ZIP2ZIP Conversion(s) ===========
- Echo Doing Final Processing...Closing Log.
-
- IF NOT Exist %1ZIP2ZIP.CVT GoTo NONE_PROC
- Echo ..Recapping This Session. The Following Files Were Processed Successfully >>%1ZIP2ZIP.LOG
- IF Exist %1ZIP2ZIP.$$$ Del %1ZIP2ZIP.$$$ >Nul
- Ren %1ZIP2ZIP.LOG ZIP2ZIP.$$$ >Nul
- Copy %1ZIP2ZIP.$$$ + %1ZIP2ZIP.CVT %1ZIP2ZIP.LOG/B >Nul
- Del %1ZIP2ZIP.$$$ >Nul
-
- :NONE_PROC
- Dir %1%2.ZIP | Find "file(s)" >>%1ZIP2ZIP.LOG
- Echo Ending Session at %ZTIME% on %ZDATE% %OS% >>%1ZIP2ZIP.LOG
- IF NOT "%SAFETY%"=="" GoTo End
- Echo !!! Aborted By Operator or Procedure Error !!! >>%1ZIP2ZIP.LOG
- GoTo End
-
- Rem ==================== Error Cheching ==========================
- :Out_Env
- Echo Not Enough Environment Size to Run. Increase in SHELL or
- Echo issue SET look at, remove some not required by SET YourSelection=
- GoTo End
-
- :Syntax
- CLS
- Echo For Re-zipping a .ZIP file possibly created under pkzip 1.10 with 2.0x
- Echo %%1 is Existing Drive:\path\ (K:\Dir30\), %%2 is ZipName (No ., No .zip ext)
- Echo DO add the "\" trailing backslash! a "*" As %%2 Will Re-Zip all .ZIPs
- Echo.
- Echo Example ZIP2ZIP \DIR20\ * (DOES ALL ZIPS In DIR20.. on Default Drive)
- Echo Or ZIP2ZIP G:\DIR20\ ABC_XYZ (DOES ABC_XYZ.ZIP Only )
- Echo Or ZIP2ZIP G:\DIR20\ ABC?XYZ (DOES ABC_XYZ.ZIP ABC1XYZ.ZIP etc.)
- Echo Or ZIP2ZIP E:\ * (DOES ROOT of E: , ALL ZIPS)
- Echo Do NOT enter the .EXT of .ZIP
- GoTo End
-
- :MajorError
- Echo A Required Program IS NOT Present OR There Exists A
- Echo Major Logic Error. Do NOT Continue Until Fixed.
- GoTo End
-
- :REQ_SD
- Echo %1Z_B, A Needed "WORK" SubDirectory Already exists..Canceling
- Echo Explore %1Z_B. If it's from prior test work
- Echo Position yourself in %1. Use ZIPRDZ_B.BAT To Remove Z_B.
- GoTo End
-
- :WRONG_PK
- Echo Must be using PKZIP version 2.04g
- Echo Run PkZIP -L to see your version no. etc.
- GoTo End
-
- :OOPS
- Echo %1%2.ZIP Not Here!
-
- :End
- For %%f IN ( FSIZE ZDATE ZTIME CNZL EVCHK40 EVCHK30 SAFETY ) DO Set %%f=
- For %%f IN ( Temp_$$$.Bat ZIP2-FSZ. EV0.FLG ) DO IF Exist %%f Del %%f >Nul
- Rem IF Exist %1ZIP2ZIP.CVT DEL %1ZIP2ZIP.CVT >Nul
- Rem Saving ZIP2ZIP.CVT File until next run. User may want to use as Move lst
-