home *** CD-ROM | disk | FTP | other *** search
/ Phoenix CD 2.0 / Phoenix_CD.cdr / 15a / commentz.zip / ZC.BAT next >
DOS Batch File  |  1989-04-23  |  5KB  |  105 lines

  1. echo off
  2.  
  3.                             goto start
  4.  
  5. :help_display
  6. echo ╔═════════════════════════════════════════════════════════════════════════════╗
  7. echo ║  Purpose: Add the contents of your ZC.TXT file as the header of specified   ║
  8. echo ║           ZIP file(s) that will be displayed when anyone unZIPs the file!   ║
  9. echo ║                                                                             ║
  10. echo ║   Syntax: ZC /h                                                             ║
  11. echo ║           ZC /s [d:]\path [d:]\path [d:]\path [d:]\path         ...etc...   ║
  12. echo ║           ZC /f [d:][\path\]filename [d:][\path\]filename       ...etc...   ║
  13. echo ║                                                                             ║
  14. echo ║    Where: /h (or /H, or blank) displays this ZC (Zip Comment) help screen   ║
  15. echo ║           /s (or /S) tells ZC you want to do an entire sub-directory full   ║
  16. echo ║           /f (or /F) tells ZC (Zip Comment) you want to do a single files   ║
  17. echo ║           [d:]     is optional drive name on which to find the "ZIP_name"   ║
  18. echo ║           [\path\] is optional pathname where the *.ZIP 's can be located   ║
  19. echo ║            \path\  is the sub-directory where the *.ZIP 's can be located   ║
  20. echo ║                                                                             ║
  21. echo ║ Examples: ZC /S D:\UPLOAD \DIR1 \DIR2                                       ║
  22. echo ║           Add contents of ZC.TXT to all ZIP files in the UPLOAD directory   ║
  23. echo ║           on drive D, then do all ZIP's in \DIR1 and \DIR2 directories on   ║
  24. echo ║           on your current drive.                                            ║
  25. echo ║                                                                             ║
  26. echo ║           Press any key to continue ...                                     ║
  27. pause > nul
  28. echo A║           ZC /F \UPLOAD\NEWFILE \DIR1\NEWFILE NEWFILE                       ║
  29. echo ║           Add contents of ZC.TXT to a file named NEWFILE.ZIP in the UPLOAD  ║
  30. echo ║           directory, the NEWFILE.ZIP in directory DIR1, and NEWFILE.ZIP in  ║
  31. echo ║           your current sub-directory, all on the current drive.             ║
  32. echo ║                                                                             ║
  33. echo ║           ZC /H                                                             ║
  34. echo ║           Displays this help screen                                         ║
  35. echo ║                                                                             ║
  36. echo ║    Notes: Create a ZC.TXT file that contains whatever you want to display   ║
  37. echo ║           when a ZIP file is unZIPped and put it in the same subdirectory   ║
  38. echo ║           along with ZC.BAT.      (Keep them both in your path somewhere)   ║
  39. echo ║                                                                             ║
  40. echo ║           Of course PKZIP.EXE must also be in your current path somewhere   ║
  41. echo ║                                                                             ║
  42. echo ║           Don't use wildcards and/or .ZIP extensions ... they won't work!   ║
  43. echo ╚═════════════════════════════════════════════════════════════════════════════╝
  44. echo ╔═════════════════════════════════════════════════════════════════════════════╗
  45. echo ║ ZC.BAT - (Zip Comment) - created by: Vernon Frazee  for: John Minton - 4/89 ║
  46. echo ╚═════════════════════════════════════════════════════════════════════════════╝
  47. goto exit
  48.  
  49. :start
  50. cls
  51. echo ╔═════════════════════════════════════════════════════════════════════════════╗
  52. echo ║               ZC.BAT (Zip Comment) is working ... please wait ...           ║
  53. echo ╚═════════════════════════════════════════════════════════════════════════════╝
  54.  
  55. :exist_zip_comment?
  56. if exist zc.txt           goto what_is_parameter_1?
  57. echo.
  58. echo ╔═════════════════════════════════════════════════════════════════════════════╗
  59. echo ║               Couldn't find your ZC.TXT! - (ZIP comment file)               ║
  60. echo ╚═════════════════════════════════════════════════════════════════════════════╝
  61. echo.
  62. goto last_message
  63.  
  64. :what_is_parameter_1?
  65. if (%1) == ()             goto help_display
  66. if (%1) == (?)            goto help_display
  67. if (%1) == (/h)           goto help_display
  68. if (%1) == (/H)           goto help_display
  69. if (%1) == (/f)           goto zc_file(s)
  70. if (%1) == (/F)           goto zc_file(s)
  71. if (%1) == (/s)           goto zc_sub-dir(s)
  72. if (%1) == (/S)           goto zc_sub-dir(s)
  73. echo 
  74. echo Error! ... %1 - Is not a a valid parameter! ...
  75. echo 
  76. zc /h
  77.  
  78. :zc_sub-dir(s)
  79. if not exist %2\*.zip     echo B%2\*.ZIP doesn't exist!
  80. if not exist %2\*.zip     goto zc_dir_shift
  81. for %%x in (%2\*.zip) do pkzip -z %%x < zc.txt
  82. :zc_dir_shift
  83. shift
  84. if (%2) == ()             echo.
  85. if (%2) == ()             goto last_message
  86. goto zc_sub-dir(s)
  87.  
  88. :zc_file(s)
  89. if not exist %2.zip       echo B%2.ZIP doesn't exist!
  90. if not exist %2.zip       goto zc_file_shift
  91. pkzip -z %2.zip  < zc.txt
  92. :zc_file_shift
  93. shift
  94. if (%2) == ()             echo.
  95. if (%2) == ()             goto last_message
  96. goto zc_file(s)
  97.  
  98. :last_message
  99. echo.
  100. echo ╔═════════════════════════════════════════════════════════════════════════════╗
  101. echo ║ ZC.BAT - (Zip Comment) - created by: Vernon Frazee  for: John Minton - 4/89 ║
  102. echo ╚═════════════════════════════════════════════════════════════════════════════╝
  103.  
  104. :exit
  105.