home *** CD-ROM | disk | FTP | other *** search
- @echo off
- echo ┌───────────────────────────────────────────────┐
- echo │ Unzip text files from zip file(s) │
- echo │ Convert Unix eolns of to PC eolns │
- echo │ preserving the original date/time stamp │
- echo │ By Prof. Timo Salmi Wed 16-Oct-1991 │
- echo └───────────────────────────────────────────────┘
- echo.
-
- rem Give usage if necessary
- if "%1"=="" goto _noname
-
- rem Check that the needed drive exists
- if not exist r:\nul goto _no_r
-
- rem Check that u2pc.bat is available (rem the test to speed up the bacth)
- set _found=
- if exist u2pc.bat set _found=yes
- for %%d in (%path%) do if exist %%d\u2pc.bat set _found=yes
- if not "%_found%"=="yes" goto _no_u2pc
-
- rem Check that unix2pc.exe is available (rem the test to speed up the bacth)
- set _found=
- if exist unix2pc.exe set _found=yes
- for %%d in (%path%) do if exist %%d\unix2pc.exe set _found=yes
- if not "%_found%"=="yes" goto _no_unix2pc
-
- rem Check that touch.exe is available (rem the test to speed up the bacth)
- set _found=
- if exist touch.exe set _found=yes
- for %%d in (%path%) do if exist %%d\touch.exe set _found=yes
- if not "%_found%"=="yes" goto _no_touch
-
- rem Check that pcopy.exe is available (rem the test to speed up the bacth)
- set _found=
- if exist pcopy.exe set _found=yes
- for %%d in (%path%) do if exist %%d\pcopy.exe set _found=yes
- if not "%_found%"=="yes" goto _no_pcopy
-
- rem Skip the redundant tests in u2pcbat
- set _checked=yes
-
- rem Make a temporary directory
- mkdir r:\tempdir$
-
- rem Unzip all the zips to the temporary directory
- for %%f in (%1) do pkunzip %%f r:\tempdir$
-
- rem Convert the Unix eolns to MsDos eolns
- for %%f in (r:\tempdir$\*.*) do call c:\bat\u2pc %%f
- @echo off
-
- rem Copy the converted files to r:\
- pcopy r:\tempdir$\*.* r:\ /u/ba/ns
-
- rem Remove the temporary files and the temporary directory
- echo y|del r:\tempdir$\*.*
- rmdir r:\tempdir$
-
- rem Show the results
- dir r:\
- goto _out
-
- :_noname
- echo ╔══════════════════════════╗
- echo ║ Usage: UNZIPTXT FileName ║
- echo ╚══════════════════════════╝
- echo.
- echo Wildcards and paths allowed
- echo.
- echo ╒══════════════════════════════════╕
- echo │ At least DOS version 3.30 needed │
- echo ╘══════════════════════════════════╛
- goto _out
-
- :_notfound
- echo File %1 not found
- goto _out
-
- :_no_r
- echo You need to have directory R:\ available, or you have to adjust r:\
- echo in the batch as befits your own configuration.
- goto _out
-
- :_no_u2pc
- echo U2PC.BAT must be at the present directory or at path.
- echo U2PC is a part of my TSFILT collection.
- goto _out
-
- :_no_unix2pc
- echo UNIX2PC.EXE must be at the present directory or at path.
- echo UNIX2PC is a part of my TSFILT collection.
- goto _out
-
- :_no_touch
- echo TOUCH.EXE must be at the present directory or at path.
- echo TOUCH is a part of my TSUTLB collection.
- goto _out
-
- :_no_pcopy
- echo Patriquin's PCOPY.EXE must be at the present directory or at path.
- goto _out
-
- :_not_text
- echo File %1 is not an ordinary ascii text file
- echo The conversion not made
- goto _out
-
- :_out
- set _found=
- set _checked=
- echo on
-