home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Phoenix CD 2.0
/
Phoenix_CD.cdr
/
15a
/
commentz.zip
/
ZC.BAT
next >
Wrap
DOS Batch File
|
1989-04-23
|
5KB
|
105 lines
echo off
goto start
:help_display
echo ╔═════════════════════════════════════════════════════════════════════════════╗
echo ║ Purpose: Add the contents of your ZC.TXT file as the header of specified ║
echo ║ ZIP file(s) that will be displayed when anyone unZIPs the file! ║
echo ║ ║
echo ║ Syntax: ZC /h ║
echo ║ ZC /s [d:]\path [d:]\path [d:]\path [d:]\path ...etc... ║
echo ║ ZC /f [d:][\path\]filename [d:][\path\]filename ...etc... ║
echo ║ ║
echo ║ Where: /h (or /H, or blank) displays this ZC (Zip Comment) help screen ║
echo ║ /s (or /S) tells ZC you want to do an entire sub-directory full ║
echo ║ /f (or /F) tells ZC (Zip Comment) you want to do a single files ║
echo ║ [d:] is optional drive name on which to find the "ZIP_name" ║
echo ║ [\path\] is optional pathname where the *.ZIP 's can be located ║
echo ║ \path\ is the sub-directory where the *.ZIP 's can be located ║
echo ║ ║
echo ║ Examples: ZC /S D:\UPLOAD \DIR1 \DIR2 ║
echo ║ Add contents of ZC.TXT to all ZIP files in the UPLOAD directory ║
echo ║ on drive D, then do all ZIP's in \DIR1 and \DIR2 directories on ║
echo ║ on your current drive. ║
echo ║ ║
echo ║ Press any key to continue ... ║
pause > nul
echo A║ ZC /F \UPLOAD\NEWFILE \DIR1\NEWFILE NEWFILE ║
echo ║ Add contents of ZC.TXT to a file named NEWFILE.ZIP in the UPLOAD ║
echo ║ directory, the NEWFILE.ZIP in directory DIR1, and NEWFILE.ZIP in ║
echo ║ your current sub-directory, all on the current drive. ║
echo ║ ║
echo ║ ZC /H ║
echo ║ Displays this help screen ║
echo ║ ║
echo ║ Notes: Create a ZC.TXT file that contains whatever you want to display ║
echo ║ when a ZIP file is unZIPped and put it in the same subdirectory ║
echo ║ along with ZC.BAT. (Keep them both in your path somewhere) ║
echo ║ ║
echo ║ Of course PKZIP.EXE must also be in your current path somewhere ║
echo ║ ║
echo ║ Don't use wildcards and/or .ZIP extensions ... they won't work! ║
echo ╚═════════════════════════════════════════════════════════════════════════════╝
echo ╔═════════════════════════════════════════════════════════════════════════════╗
echo ║ ZC.BAT - (Zip Comment) - created by: Vernon Frazee for: John Minton - 4/89 ║
echo ╚═════════════════════════════════════════════════════════════════════════════╝
goto exit
:start
cls
echo ╔═════════════════════════════════════════════════════════════════════════════╗
echo ║ ZC.BAT (Zip Comment) is working ... please wait ... ║
echo ╚═════════════════════════════════════════════════════════════════════════════╝
:exist_zip_comment?
if exist zc.txt goto what_is_parameter_1?
echo.
echo ╔═════════════════════════════════════════════════════════════════════════════╗
echo ║ Couldn't find your ZC.TXT! - (ZIP comment file) ║
echo ╚═════════════════════════════════════════════════════════════════════════════╝
echo.
goto last_message
:what_is_parameter_1?
if (%1) == () goto help_display
if (%1) == (?) goto help_display
if (%1) == (/h) goto help_display
if (%1) == (/H) goto help_display
if (%1) == (/f) goto zc_file(s)
if (%1) == (/F) goto zc_file(s)
if (%1) == (/s) goto zc_sub-dir(s)
if (%1) == (/S) goto zc_sub-dir(s)
echo
echo Error! ... %1 - Is not a a valid parameter! ...
echo
zc /h
:zc_sub-dir(s)
if not exist %2\*.zip echo B%2\*.ZIP doesn't exist!
if not exist %2\*.zip goto zc_dir_shift
for %%x in (%2\*.zip) do pkzip -z %%x < zc.txt
:zc_dir_shift
shift
if (%2) == () echo.
if (%2) == () goto last_message
goto zc_sub-dir(s)
:zc_file(s)
if not exist %2.zip echo B%2.ZIP doesn't exist!
if not exist %2.zip goto zc_file_shift
pkzip -z %2.zip < zc.txt
:zc_file_shift
shift
if (%2) == () echo.
if (%2) == () goto last_message
goto zc_file(s)
:last_message
echo.
echo ╔═════════════════════════════════════════════════════════════════════════════╗
echo ║ ZC.BAT - (Zip Comment) - created by: Vernon Frazee for: John Minton - 4/89 ║
echo ╚═════════════════════════════════════════════════════════════════════════════╝
:exit