home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the DOOM Programming Gurus / Tricks_of_the_Doom_Programming_Gurus.iso / bonus / utils / doomchk / tryme.bat < prev   
Encoding:
DOS Batch File  |  1995-03-19  |  9.2 KB  |  290 lines

  1. @echo off
  2. rem ***********************************************************************
  3. rem * DMCHECK by Jean-Serge Gagnon  (az589@freenet.carleton.ca)           *
  4. rem * This file TRYME.BAT by Jean-Serge Gagnon also.                      *
  5. rem ***********************************************************************
  6. rem * Check ftp.cdrom.com or the Synapse BBS at (819) 246-2344 for the    *
  7. rem * latest version.                                                     *
  8. rem ***********************************************************************
  9. cls
  10. echo  
  11. echo  
  12. echo  
  13. echo This batch program will use all of the features of DMCHECK to show you how
  14. echo it is used.
  15. echo  
  16. echo  
  17. echo  
  18. echo  
  19. echo              1- Start at the DOOM version test.
  20. echo  
  21. echo              2- Go to the Disk space test.
  22. echo  
  23. echo              3- Go to the COMMAND.COM test.
  24. echo  
  25. echo              X- Go directly to the end text.
  26. echo  
  27. echo            ESC- Quit straight to DOS!
  28. echo  
  29. echo  
  30. dmcheck /q ask "Select from the above menu: " 123X
  31. cls
  32. if errorlevel == 255 goto totalend
  33. if errorlevel == 4 goto end2
  34. if errorlevel == 3 goto comtest1
  35. if errorlevel == 2 goto nowhich
  36. if errorlevel == 1 goto start
  37. echo Opps, I got a weird happening while doing the MENU function.
  38. goto mail
  39. :start
  40. echo I will now execute the following command:
  41. echo  
  42. echo DMCHECK WHICH /Q
  43. echo  
  44. echo This will check the installed DOOM version and return an ERRORLEVEL code
  45. echo describing the version installed. The /Q switch prevents the display of the
  46. echo DMCHECK text. After the execution of DMCHECK, the batch file will execute
  47. echo code based on that ERRORLEVEL code to indicate the version...
  48. echo  
  49. dmcheck w /q
  50. if not errorlevel == 255 goto not255
  51. echo No DOOM version found!
  52. goto end
  53. :not255
  54. if not errorlevel == 31 goto not31
  55. echo You have a modified copy of DOOM 1.2 called the SYBEX version 1.25.
  56. goto end
  57. :not31
  58. if not errorlevel == 30 goto not30
  59. echo You have a modified copy of DOOM from the PC-ZONE CDROM! It is like ver 1.2
  60. echo but with a modified EXE file.
  61. goto end
  62. :not30
  63. if not errorlevel == 26 goto not26
  64. echo You have a more recent version than 1.9 of DOOM ][.
  65. goto end
  66. :not26
  67. if not errorlevel == 25 goto not25
  68. echo DOOM ][ ver 1.9
  69. goto end
  70. :not25
  71. if not errorlevel == 24 goto not24
  72. echo DOOM ][ ver 1.8
  73. goto end
  74. :not24
  75. if not errorlevel == 23 goto not23
  76. echo DOOM ][ ver 1.7a
  77. goto end
  78. :not23
  79. if not errorlevel == 22 goto not22
  80. echo DOOM ][ ver 1.7
  81. goto end
  82. :not22
  83. if not errorlevel == 21 goto not21
  84. echo DOOM ][ ver 1.666
  85. goto end
  86. :not21
  87. if not errorlevel == 19 goto not19
  88. echo You have the a pirated copy of DOOM ][! Shame on you!!!
  89. goto end
  90. :not19
  91. if not errorlevel == 11 goto not11
  92. dmcheck v 1.9 /q
  93. if not errorlevel == 1 goto ok9
  94. echo Version 1.9 of DOOM 1 sharewear.
  95. goto end
  96. :ok9
  97. echo Version 1.9 of DOOM 1 registered.
  98. goto end
  99. :not11
  100. if not errorlevel == 10 goto not10
  101. dmcheck v 1.8 /q
  102. if not errorlevel == 1 goto ok8
  103. echo Version 1.8 of DOOM 1 sharewear.
  104. goto end
  105. :ok8
  106. echo Version 1.8 of DOOM 1 registered.
  107. goto end
  108. :not10
  109. if not errorlevel == 9 goto not9
  110. dmcheck v 1.7a /q
  111. if not errorlevel == 1 goto ok7a
  112. echo Version 1.7a of DOOM 1 sharewear.
  113. goto end
  114. :ok7a
  115. echo Version 1.7a of DOOM 1 registered.
  116. goto end
  117. :not9
  118. if not errorlevel == 8 goto not8
  119. dmcheck v 1.7 /q
  120. if not errorlevel == 1 goto ok7
  121. echo Version 1.7 of DOOM 1 sharewear.
  122. goto end
  123. :ok7
  124. echo Version 1.7 of DOOM 1 registered.
  125. goto end
  126. :not8
  127. if not errorlevel == 7 goto not7
  128. dmcheck v 1.666 /q
  129. if not errorlevel == 1 goto ok6
  130. echo You have version 1.666 all right, but it's the shareware version!
  131. goto end
  132. :ok6
  133. echo Since you have DOOM 1.666, then the PWAD should be executed with
  134. echo DOOM -FILE FOREST.WAD DEMO12.WAD, otherwise DOOM would tell you
  135. echo that the demos were not for ver 1.666 and would exit.
  136. goto end
  137. :not7
  138. if not errorlevel == 6 goto not6
  139. echo DOOM 1.6 beta, this is only a shareware verison.
  140. goto end
  141. :not6
  142. if not errorlevel == 5 goto not5
  143. echo DOOM 1.5 beta, this is only a shareware version.
  144. goto end
  145. :not5
  146. if not errorlevel == 4 goto not4
  147. echo DOOM 1.4 beta, only shareware.
  148. goto end
  149. :not4
  150. if not errorlevel == 3 goto not3
  151. echo Since you have DOOM 1.2, then we could run a PWAD made for it instead of
  152. echo displaying this.
  153. dmcheck /q v 1.2
  154. if not errorlevel == 1 goto end
  155. echo but since you have the shareware version, we still can't.
  156. goto end
  157. :not3
  158. if not errorlevel == 2 goto not2
  159. echo Somebody that has DOOM 1.1 would get a message saying that the
  160. echo PWAD isn't usable with that version and he should upgrade to 1.2
  161. dmcheck /q v 1.1
  162. if not errorlevel == 1 goto end
  163. echo Also, this is only the shareware of 1.1, sorry can't do much!
  164. goto end
  165. :not2
  166. if not errorlevel == 1 goto not1
  167. echo And for DOOM 1.0, you have to upgrade to 1.1, then 1.2 and today 1.666!
  168. dmcheck /q v 1.0
  169. if not errorlevel == 1 goto end
  170. echo on top of that, this is the first shareware release of DOOM!
  171. goto end
  172. :not1
  173. echo Oops got an errorlevel of 0 which shouldn't happen!
  174. :mail
  175. echo Please send e-mail to me (Jean-Serge Gagnon) at az589@freenet.carleton.ca
  176. echo and tell me about it. Thanks.
  177. goto totalend
  178. :end
  179. pause
  180. cls
  181. :nowhich
  182. echo  
  183. echo  
  184. echo                ******** new features of DMCHECK *********
  185. echo  
  186. echo Since version 3.0 of DMCHECK, there are two new functions that will make
  187. echo it easier for batch files. For example, let's say that you have a PWAD that
  188. echo works only with ver 1.0 of DOOM and you tested for it with the VERSION function
  189. echo found that it wasn't the installed version, instead of writing a long
  190. echo batch file to test for each of the possible ERRORLEVEL codes, you could 
  191. echo just use the WHICH function with the /M and /U switches and have an echo line
  192. echo like this code:
  193. echo  
  194. echo ECHO I'm sorry, I do not support
  195. echo DMCHECK WHICH /M /U
  196. echo  
  197. echo which would result in the following output...
  198. echo  
  199. echo I'm sorry, I do not support
  200. dmcheck w /m /u
  201. echo  
  202. echo Pretty nice, eh!
  203. pause
  204. cls
  205. echo  
  206. echo OK, now let's try the S[pace] function. We will test to see if there is
  207. echo more than 10,000,000 bytes free on a drive, but first, let's give the A[sk]
  208. echo function a try...
  209. dmcheck /q ask "Which drive to test [C-F]? " CDEF
  210. if not errorlevel == 255 goto nota255
  211. echo You pressed [Escape], I guess we can forget about this test!!!
  212. goto end2
  213. :nota255
  214. if not errorlevel == 4 goto nota4
  215. echo Testing drive F:...
  216. echo --------- DMCHECK displays this when used with /d parameter ----------
  217. dmcheck space /d f 10,000,000
  218. if errorlevel == 255 goto driverror
  219. goto cont
  220. :nota4
  221. if not errorlevel == 3 goto nota3
  222. echo Testing drive E:...
  223. echo --------- DMCHECK displays this when used with /d parameter ----------
  224. dmcheck space /d e 10,000,000
  225. if errorlevel == 255 goto driverror
  226. goto cont
  227. :nota3
  228. if not errorlevel == 2 goto nota2
  229. echo Testing drive D:...
  230. echo --------- DMCHECK displays this when used with /d parameter ----------
  231. dmcheck /d s d 10,000,000
  232. if errorlevel == 255 goto driverror
  233. goto cont
  234. :nota2
  235. if not errorlevel == 1 goto nota1
  236. echo Testing drive C:...
  237. echo --------- DMCHECK displays this when used with /d parameter ----------
  238. dmcheck space /d c 10,000,000
  239. if errorlevel == 255 goto driverror
  240. goto cont
  241. :driverror
  242. echo  
  243. echo ----------------------- end of DMCHECK text -----------------------------
  244. echo Sorry, either there was an error accessing the drive or you simply don't
  245. echo have that drive installed!
  246. goto comtest
  247. :nota1
  248. echo Opps, I got a weird happening while doing the Ask function.
  249. goto mail
  250. :cont
  251. echo  
  252. echo ----------------------- end of DMCHECK text -----------------------------
  253. if errorlevel == 1 goto nofree
  254. echo There is at least 10,000,000 bytes free on the requested drive.
  255. goto comtest
  256. :nofree
  257. echo There is less than 10,000,000 bytes on the requested drive, sorry!
  258. :comtest
  259. pause
  260. :comtest1
  261. cls
  262. echo Now, let's use the F[ile] funcion to test the file size, data and time of
  263. echo the file C:\COMMAND.COM. This can be used to test for a DOOM version that
  264. echo DMCHECK doesn't know about yet or some other use...
  265. dmcheck file c:\command.com/q 47845 05-30-91 12:00:00
  266. echo  
  267. if not errorlevel == 255 goto n255
  268. echo You do not have any COMMAND.COM file in C:\!
  269. goto end2
  270. :n255
  271. if not errorlevel == 1 goto n1
  272. echo You do not have the same version of MS-DOS than me!
  273. goto end2
  274. :n1
  275. echo You have the COMMAND.COM file for MS-DOS 5.0 in the root of drive C:.
  276. :end2
  277. echo  
  278. echo There are many  things that can be done with DMCHECK if used properly. You
  279. echo could check for the existance of the first release of DOOM ][ and tell the
  280. echo user that it may be a pirated copy. You  could also check that the version
  281. echo of DOOM that  is  installed  is a  shareware copy  and  display  a message
  282. echo explaining that the user needs to have  the registered copy of DOOM to use
  283. echo your  PWAD file,  instead of having  people send  you e-mail  or phone you
  284. echo asking things like that. People want easy things to do, and DMCHECK  makes
  285. echo it that much  simpler to use PWAD files for the end-user without having to
  286. echo learn anything else than typing in a batch file name at the DOS prompt!
  287. echo  
  288. echo Jean-Serge Gagnon (az589@freenet.carleton.ca)
  289. :totalend
  290.