home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / ka9q / pcelm321.zip / SHOWPART.BAT < prev   
DOS Batch File  |  1993-07-11  |  3KB  |  203 lines

  1. @echo off
  2. REM
  3. REM showpart.bat; an MSDOS batch language variant of the Cshell script
  4. REM showpart for MIME
  5. REM
  6. REM Ported to MSDOS by Martin Freiss, freiss.pad@sni.de
  7. REM
  8. REM Syntax is
  9. REM showpart filename msgid part allparts
  10. REM
  11. REM check if TMP environment variable is set
  12. IF a%TMP%==a GOTO notmp
  13. :gottmp
  14.  
  15. REM egregious hack to overcome the notorious root directory difficulty.
  16. REM oh, for a _real_ operating system...
  17. IF %TMP%==c:\ GOTO C
  18. IF %TMP%==C:\ GOTO C
  19. IF %TMP%==d:\\ GOTO D
  20. IF %TMP%==D:\ GOTO D
  21. IF %TMP%==e:\ GOTO E
  22. IF %TMP%==E:\ GOTO E
  23. IF %TMP%==f:\ GOTO F
  24. IF %TMP%==F:\ GOTO F
  25. IF %TMP%==g:\ GOTO g
  26. IF %TMP%==G:\ GOTO G
  27. IF %TMP%==h:\ GOTO h
  28. IF %TMP%==H:\ GOTO H
  29. IF %TMP%==i:\ GOTO i
  30. IF %TMP%==I:\ GOTO I
  31. IF %TMP%==j:\ GOTO j
  32. IF %TMP%==J:\ GOTO J
  33. IF %TMP%==k:\ GOTO k
  34. IF %TMP%==K:\ GOTO K
  35. IF %TMP%==l:\ GOTO l
  36. IF %TMP%==L:\ GOTO L
  37. IF %TMP%==m:\ GOTO m
  38. IF %TMP%==M:\ GOTO M
  39. IF %TMP%==n:\ GOTO n
  40. IF %TMP%==N:\ GOTO N
  41. IF %TMP%==o:\ GOTO o
  42. IF %TMP%==O:\ GOTO O
  43. IF %TMP%==p:\ GOTO p
  44. IF %TMP%==P:\ GOTO P
  45. IF %TMP%==q:\ GOTO q
  46. IF %TMP%==Q:\ GOTO Q
  47. IF %TMP%==r:\ GOTO r
  48. IF %TMP%==R:\ GOTO R
  49. IF %TMP%==s:\ GOTO s
  50. IF %TMP%==S:\ GOTO S
  51. IF %TMP%==t:\ GOTO t
  52. IF %TMP%==T:\ GOTO T
  53. IF %TMP%==u:\ GOTO u
  54. IF %TMP%==U:\ GOTO U
  55. IF %TMP%==v:\ GOTO v
  56. IF %TMP%==V:\ GOTO V
  57. IF %TMP%==w:\ GOTO w
  58. IF %TMP%==W:\ GOTO W
  59. IF %TMP%==x:\ GOTO x
  60. IF %TMP%==X:\ GOTO X
  61. IF %TMP%==y:\ GOTO y
  62. IF %TMP%==Y:\ GOTO Y
  63. IF %TMP%==z:\ GOTO z
  64. IF %TMP%==Z:\ GOTO Z
  65.  
  66. :mkwork
  67.  
  68. REM make a work directory, and copy the file there
  69. mkdir %TMP%\mime
  70.  
  71. REM check if file exists already.
  72. IF EXIST %TMP%\mime\%3 goto fileexists
  73.  
  74. copy %1 %TMP%\mime\%3
  75. IF %3==%4 GOTO gotall
  76.  
  77. echo Done part %3
  78. GOTO end
  79.  
  80. :fileexists
  81. REM multiple partial messages are being decoded
  82. echo Sorry, can handle only one split MIME mail at a time.
  83. echo There already is a partial message with this part number. The mail
  84. echo you are currently reading belongs to another split message.
  85. echo
  86. echo Mail not processed.
  87.  
  88. goto end
  89.  
  90. :gotall
  91. FOR %%i IN (%TMP%\mime\*) DO type %%i >> %TMP%\mime\full.mm
  92.  
  93. REM delete partial files
  94. for %%i in (%TMP%\mime\*) do del %%i
  95.  
  96. REM do something with the file
  97. metamail -d %TMP%\mime\full.mm
  98. echo To save space, the full file is now being deleted. You will have
  99. echo to read all %4 parts again to see the full message.
  100. rem del %TMP%\mime\full.mm
  101. goto end
  102.  
  103. :C
  104. set TMP=c:
  105. GOTO mkwork
  106.  
  107. :D
  108. set TMP=d:
  109. GOTO mkwork
  110.  
  111. :E
  112. set TMP=e:
  113. GOTO mkwork
  114.  
  115. :F
  116. set TMP=f:
  117. GOTO mkwork
  118.  
  119. :G
  120. set TMP=g:
  121. GOTO mkwork
  122.  
  123. :H
  124. set TMP=h:
  125. GOTO mkwork
  126.  
  127. :I
  128. set TMP=i:
  129. GOTO mkwork
  130.  
  131. :J
  132. set TMP=j:
  133. GOTO mkwork
  134.  
  135. :K
  136. set TMP=k:
  137. GOTO mkwork
  138.  
  139. :L
  140. set TMP=l:
  141. GOTO mkwork
  142.  
  143. :M
  144. set TMP=m:
  145. GOTO mkwork
  146.  
  147. :N
  148. set TMP=n:
  149. GOTO mkwork
  150.  
  151. :O
  152. set TMP=o:
  153. GOTO mkwork
  154.  
  155. :P
  156. set TMP=p:
  157. GOTO mkwork
  158.  
  159. :Q
  160. set TMP=q:
  161. GOTO mkwork
  162.  
  163. :R
  164. set TMP=r:
  165. GOTO mkwork
  166.  
  167. :S
  168. set TMP=s:
  169. GOTO mkwork
  170.  
  171. :T
  172. set TMP=t:
  173. GOTO mkwork
  174.  
  175. :U
  176. set TMP=u:
  177. GOTO mkwork
  178.  
  179. :V
  180. set TMP=v:
  181. GOTO mkwork
  182.  
  183. :W
  184. set TMP=w:
  185. GOTO mkwork
  186.  
  187. :X
  188. set TMP=x:
  189. GOTO mkwork
  190.  
  191. :Y
  192. set TMP=y:
  193. GOTO mkwork
  194.  
  195. :Z
  196. set TMP=z:
  197. GOTO mkwork
  198.  
  199. :notmp
  200. echo TMP not set. Please set TMP to a directory to use for temporary files.
  201.  
  202. :end
  203. pause