home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 June / SIMTEL_0692.cdr / msdos / zip / any2zip4.arc / ANY2ZIP.BAT next >
Encoding:
DOS Batch File  |  1989-07-05  |  1.3 KB  |  63 lines

  1. @echo off
  2. for %%f in (\a2zerr\*.*) do del %%f >nul
  3. if exist \a2zerr\nul rd \a2zerr >nul
  4.  
  5. :FIRST
  6.    if "%1" == ""  goto ZIPTEST
  7.    for %%f in (x X 1 2 3 4) do if "%%f" == "%1" goto SECOND
  8.    goto ERROR
  9.  
  10. :SECOND
  11.    if "%2" == ""  goto ZIPTEST
  12.    for %%f in (1 2 3 4) do if "%%f" == "%2" goto ZIPTEST
  13.    goto ERROR
  14.  
  15. :ZIPTEST
  16.    md any2zip
  17.    if exist *.zip goto ZIPTEMP
  18.  
  19. :START
  20.    set ARCTYPE=
  21.    for %%f in (ARC LZH PAK ZOO) do if exist *.%%f set ARCTYPE=%%f
  22.    if "%ARCTYPE%" == "" goto END
  23.    for %%f in (*.%ARCTYPE%) do call any2zip1 %%f %1 %2
  24.    echo.
  25.    echo ═══ All %ARCTYPE% files processed ═══
  26.    echo.
  27.    goto START
  28.  
  29. :ZIPTEMP
  30.    md ziptemp
  31.  
  32. :ZIPTEMP1
  33.    copy *.zip ziptemp >nul
  34.    for %%g in (*.zip) do if exist ziptemp\%%g del %%g
  35.    if exist *.zip goto ZIPTEMP1
  36.    goto START
  37.  
  38. :ZIPMOVE
  39.    cd ziptemp
  40.    for %%g in (*.zip) do if exist ..\%%g ren %%g *.z$p
  41.    copy *.* .. >nul
  42.    del *.z?p >nul
  43.    cd ..
  44.    rd ziptemp
  45.    if exist *.?$? echo ═══ Old ZIP files renamed *.Z$P ═══
  46.  
  47. :END
  48.    if exist ziptemp\*.zip goto ZIPMOVE
  49.    echo.
  50.    echo ═══ Done with all files ═══
  51.    echo.
  52.    rd any2zip
  53.    goto EXIT
  54.  
  55. :ERROR
  56.    echo.
  57.    echo Usage: Any2zip [Text compression (1-4)] [Binary compression (1-4)]
  58.    echo.
  59.  
  60. :EXIT
  61. if exist \a2zerr\*.log echo ═══ Check ANY2ZIP.LOG for errors ═══
  62. echo.
  63.