home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / UTILITY / UPLD-BAT.ARJ / UPLOAD.BAT
DOS Batch File  |  1991-12-08  |  4KB  |  133 lines

  1. My upload.bat event
  2. Darrell Mobley #1 @9402
  3. Mon Nov 25 01:08:49 1991
  4. 5Several of the users here have requested an upload event that would scan their
  5. 5uploads, and I myself floundered with trying to find one for a long time.
  6. 5Well, Rodeo Doc at 5213 sent me one that he was using with a RAMdisk and I
  7. 5modified it to work with the \TEMP directory.  ALL the credit of this file goes
  8. 5to Rodeo Doc, #1 @5213.  I just modified it to work for me.  What it does is
  9. 5copies the upload to the \TEMP directory, if it is zipped, arced, packed, or
  10. 5arjed, it will unarchive it, then it will scan the programs in the \TEMP
  11. 5directory.  If it finds a bad upload, it scratches the files.  Otherwise, it
  12. 5adds a zipcomment file and continues the upload.
  13.  
  14. 51. Enter the INIT program, chose option 6, and enter an upload event filename.
  15. 5I used "upload.bat" as mine.  Enter it such as "upload.bat %1 %2 %3"
  16.  
  17. 52. Put this following file in the main \WWIV directory and name it "upload.bat"
  18.  
  19. 5------------
  20. @echo Cleaning old files from \TEMP directory...
  21. @echo off
  22. if exist C:\WWIV\TEMP\*.* del C:\WWIV\TEMP\*.* < C:\WWIV\ultest.y 
  23.  
  24. @echo Copying File to test directory ...
  25. @echo Supplied parameter: %2%3
  26. @echo off
  27. copy %2%3 C:\WWIV\TEMP
  28.  
  29. if exist C:\WWIV\TEMP\*.zip goto zip
  30. if exist C:\WWIV\TEMP\*.arc goto arc
  31. if exist C:\WWIV\TEMP\*.arj goto arj
  32. if exist C:\WWIV\TEMP\*.lzh goto lzh
  33.  
  34. @echo Unrecognized Archive!
  35. goto bye
  36.  
  37. :zip
  38. @echo Performing .ZIP uncompression ...
  39. @echo off
  40. pkunzip C:\WWIV\TEMP\*.zip C:\WWIV\TEMP -o 
  41. if errorlevel 1 goto bad_ul
  42. goto scan
  43.  
  44. :arc
  45. @echo Performing .ARC uncompression ...
  46. @echo off
  47. pkunpak C:\WWIV\TEMP\*.arc C:\WWIV\TEMP
  48. if errorlevel 1 goto bad_ul
  49. goto scan
  50.  
  51. :lzh
  52. @echo Performing .LZH uncompression ...
  53. @echo off
  54. lha e C:\WWIV\TEMP\*.lzh C:\WWIV\TEMP\ /m1 /c1
  55. if errorlevel 1 goto bad_ul
  56. goto scan
  57.  
  58. :arj
  59. @echo Performing .ARJ uncompression ...
  60. @echo off
  61. arj e -y C:\WWIV\TEMP\*.arj C:\WWIV\TEMP
  62. if errorlevel 1 goto bad_ul
  63. goto scan
  64.  
  65. :scan
  66. @echo Scanning ...
  67. @echo off
  68. scan /nomem /x /a C:\WWIV\TEMP\*.* 
  69. if errorlevel 1 goto bad_ul
  70.  
  71. @echo Passed all tests!
  72.  
  73. @echo off
  74. if exist C:\WWIV\TEMP\*.zip goto com_zip
  75. if exist C:\WWIV\TEMP\*.arc goto com_arc
  76. if exist C:\WWIV\TEMP\*.arj goto com_arj
  77.  
  78. @echo This archive does not support comments!
  79. goto ok
  80.  
  81. :com_zip
  82. @echo Adding Comment to .ZIP file ...
  83. @echo off
  84. pkzip %2%3 -Z<C:\WWIV\zipcom
  85. goto ok
  86.  
  87. :com_arj
  88. @echo Adding Comment to .ARJ file ...
  89. @echo off
  90. arj c %2%3 -zC:\WWIV\zipcom
  91. goto ok
  92.  
  93. :com_arc
  94. @echo Adding Comment to .ARC file ...
  95. @echo off
  96. pkpak c %2%3 <C:\WWIV\zipcom
  97. goto ok
  98.  
  99. :bad_ul
  100. @echo Bad Upload.  Deleting corrupt or virus ridden file ...
  101. @echo off
  102. cd C:\WWIV
  103. del %2%3 < C:\WWIV\ultest.y
  104.  
  105. :ok
  106. @echo Deleting work files ...
  107. @echo off
  108. if exist C:\WWIV\TEMP\*.* del C:\WWIV\TEMP\*.* < C:\WWIV\ultest.y 
  109. cd C:\WWIV
  110.  
  111. :bye
  112. @echo off
  113. EXIT
  114. 5--------------
  115.  
  116. 53. Put McAffee's SCAN.EXE, your archive utilities (pkzip, pkunzip, pkpak,
  117. 5lharc, and arj) into the main \WWIV directory as well.
  118.  
  119. 54. Create a file called "ultest.y" and edit it to ONLY hold a "Y" and a
  120. 5carriage return in it.  Place this in the main \WWIV directory also.
  121.  
  122. 55. Create a Zip comment file named "zipcom" which will hold your BBS name,
  123. 5number, etc.  This file will be automatically added to the uploaded zip, arc,
  124. 5and arj files as they are scanned.  Place this in your main \WWIV directory.
  125.  
  126. 56. You should be ready to scan uploads.  If you have any problems with this, I
  127. 5am sorry.  I am not your BBS's momma, so don't write me if it wipes out your
  128. 5BBS.  Speaking of that, that is probably why no one has uploaded one of these
  129. 5before, as some people can screw up anything.  If in doubt, make a backup.
  130.  
  131. 1Data*West BBS  2(904)/278-8065  300-2400 Baud  1WWIVNet @9402
  132. 3Jacksonville, Florida  5----  3Gateway to the South
  133.