home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 033 / info301a.zip / INFO.BTM (.txt) < prev    next >
4DOS Compressed Batch-To-Memory File  |  1994-12-29  |  11KB  |  413 lines

  1. @Echo Off
  2. Cls
  3.  
  4. REM {
  5. REM INFO.BTM 3.01 Revision A
  6. REM Copyright 1994,95 by Matt Walters; all rights reserved.
  7. REM }
  8.  
  9. REM {
  10. REM Ok, Here is where it all starts, I just made it so that not everyhing in
  11. REM this BTM file is shown (REM statements and so on).  Right here I make sure
  12. REM that the program will terminate if CTRL-C or CTRL-BRK is pressed.  Some
  13. REM people turn this off, I just want to make sure that break checking is on
  14. REM so that they can stop the program if neccassary.
  15. REM }
  16.  
  17. Break On
  18.  
  19. REM {
  20. REM ***************************************************************************
  21. REM Legal time...
  22. REM I own this program, don't mess with it and then distribute yours...
  23. REM ***************************************************************************
  24. REM }
  25.  
  26. REM {
  27. REM I use the {} to make my comments stick out.  It comes from brief Turbo
  28. REM Pascal programming "career".  Just live with it, if you can't then stop
  29. REM using the program...  :)
  30. REM }
  31.  
  32.  
  33. REM {
  34. REM Ok, here I test to see if 4DOS is around.  I also test to see if it is 5.5
  35. REM or higher.  It it's not then it will produce a fatal error.  (Can't have
  36. REM people using is on an un-compatible system and then blaming me!)  ;)
  37. REM }
  38.  
  39. If Not "%@eval[2+2]" == "4" goto Messed_Up
  40. Iff "%_4Ver" lt "5.5" then
  41.                         goto Messed_Up
  42.                     Else
  43.                         goto Start_The_Program
  44. EndIff                  
  45.  
  46. :Start_The_Program
  47.  
  48. REM {
  49. REM Here I make sure that if something goes wrong, the program knows what to
  50. REM do.  If an error occurs, the program is sent to a place that will tell
  51. REM the user as much information as it can, or if CTRL-C or CTRL-BRK is pressed
  52. REM then they are told so and a fatal error usually is caused by this...
  53. REM }
  54.  
  55. On Break goto Broken
  56. On Error goto Messed_Up
  57.  
  58. REM {
  59. REM Ok, here, all I do is clear out the environment so that I have room to do
  60. REM stuff, it all gets set back again when I'm done...  I also initialize any
  61. REM variables that will later be used...
  62. REM }
  63.  
  64. SetLocal
  65. UNSET *
  66. UNALIAS *
  67.  
  68. REM {
  69. REM I want to make sure anything done to the HDD is checked, nothing should
  70. REM be written to the HDD though.
  71. REM }
  72.  
  73. Verify On
  74.  
  75. REM {
  76. REM Here I start what will turn into an algorigthm by changing the drive letter
  77. REM to a number so that I can play math with it for easier changing of drive
  78. REM letters on a system that I (The programmer) don't know about...
  79. REM }
  80.  
  81. Set DISK=%@ASCII[%_BOOT]
  82. Set LD=%@ASCII[%_LASTDISK]
  83.  
  84. REM {
  85. REM IntroDuction.  I just tell the user what the program is, the version, and
  86. REM who I am right here...
  87. REM }
  88.  
  89. :Lets_Do_It
  90. Cls
  91. DrawBox 0 30 6 52 3 bri whi on green fill green
  92. scrput 0 37 red on green      INFO 3.01a
  93. REM scrput 1 38 bri whi on bla       Creator:
  94. REM scrput 2 36 bri whi on bla     Matt Walters
  95. REM scrput 3 37 bri whi on bla      PRESiDENT
  96. REM scrput 4 36 bri whi on bla     LoST SECToR
  97. REM scrput 5 37 bri whi on bla      SoFTWaRE
  98. scrput 1 31 bri whi on green CPU: 80-%_CPU
  99. scrput 2 31 bri whi on green Math-Co: 80-%_NDP
  100. scrput 3 31 bri whi on green Shell level: %_SHELL
  101. scrput 4 31 bri whi on green Date: %_DATE
  102. scrput 5 31 bri whi on green Time: %_TIME
  103.  
  104. REM {
  105. REM Here, I've made a place for my BTM file to come back to in case I'd like
  106. REM it to do a continous loop.  Of course this would mean my taking out the
  107. REM PAUSE statement later in the program and changing it to a delay so that
  108. REM it was still readable but didn't require any intervention by the user.
  109. REM }
  110.  
  111. :Loop
  112. REM {
  113. REM Ok, now I'm drawing the first box in the upper left-hand corner of the
  114. REM screen.  This one tells the basics about the system, such as what type
  115. REM of monitor is hooked up (as if you didn't know by looking <g>).  Things
  116. REM like that, and the BOOT disk and what the LASTDISK is...  I added the
  117. REM codepage because I thought that maybe some one out there new what it was
  118. REM for, personally, I don't fell like telling it here...so don't ask me,
  119. REM that's for your local guru to tell you about.    :)
  120. REM }
  121.  
  122. DrawBox 0 1 6 24 4 bri gree on mag fill mag
  123. scrput 0 3 bri gree on mag System info:
  124.  
  125. REM {
  126. REM Take note of the %@UPPER[<Text>].  It will take some text that you put in
  127. REM there and put it in uppercase.  Users, some of them, like seeing
  128. REM directories in upper case, this is great for using with variables like %_CWD
  129. REM and things like that...
  130. REM }
  131.  
  132. scrput 1 2 bri gree on mag Monitor type: %@UPPER[%_Monitor]
  133. scrput 2 2 bri gree on mag Video Board: %@UPPER[%_VIDEO]
  134. scrput 3 2 bri gree on mag Boot Drive: %_BOOT
  135. scrput 4 2 bri gree on mag Last drive: %_LASTDISK
  136. scrput 5 2 bri gree on mag Code Page: %@COMMA[%_CODEPAGE]
  137.  
  138.  
  139. REM {
  140. REM Alright, this is the second window, the one in the upper right-hand corner.
  141. REM Here I tell more detail about the system, like what country it's
  142. REM set up for.  Believe it or not that is actually useful.  Since some conf-
  143. REM igurations are set similiar but different...  Any more questions?  That's
  144. REM also for the local guru...  I also test for the presence of a DPMI driver,
  145. REM and if it's found, I tell you, if not then, what else?  I tell you it's
  146. REM not there (big surprise to you I'm sure... <g>)
  147. REM }
  148.  
  149. DrawBox 0 57 6 78 4 bri whi on blu fill blu
  150. scrput 0 59 bri whi on blu Software info:
  151. scrput 1 58 bri whi on blu Country Code: %_COUNTRY
  152. scrput 2 58 bri whi on blu OS: %_DOS
  153. scrput 3 58 bri whi on blu OS Version: %@COMMA[%_DOSVER]
  154. scrput 4 58 bri whi on blu 4DOS Version: %@COMMA[%_4VER]
  155.  
  156. REM {
  157. REM Here's where I'm testing for DPMI presence...
  158. REM }
  159.  
  160. Iff "%_DPMI" == "1" then
  161.                         scrput 5 58 bri whi on blu DPMI Number: %_DPMI
  162.                     else
  163.                         scrput 5 58 bri whi on blu DPMI: Not present
  164.  
  165. REM {
  166. REM Hmm, (couldn't think of another way to start this one <g>...hope that's
  167. REM good enough, alright and Ok were already taken <g>).  Anyways, Here I draw
  168. REM final box.  This is the one on the bottom, which ALMOST has an appearance
  169. REM of scrolling, I haven't been bored enough to do it yet though, that too
  170. REM will come in a later version.  I also test to see if DESQView<tm> is around
  171. REM and if so tell you, if not don't tell you (Deja Vu?, I think not <g>).
  172. REM }
  173.  
  174. drawbox 8 1 16 78 4 bla on red fill red
  175. scrput 8 4 bla on red Memmory info:
  176.  
  177. REM {
  178. REM Ok, this is a function of 4DOS that's great, use it EVERYWHERE you possibly
  179. REM can.  It makes for easier reading to the user.  What I'm talking about is
  180. REM the %@COMMA[<text>].  Read the manual to find out more about this one.  It
  181. REM takes a number and places commas inside the number to make it look nice.
  182. REM It doesn't take long to do, just fill in <text> with what you want it to
  183. REM put commas in (ie. Number that you are too lazy to put your own commas in
  184. REM or a numeric variable, it'll probably give you an error if you try to do
  185. REM this one on a variable that doesn't have numbers in it...
  186. REM }
  187.  
  188. If "%Working" == "1" Goto Wierd_Loop
  189. scrput 9 2 bla on Red Alias space: %@COMMA[%_ALIAS]
  190. scrput 10 2 bla on Red Enivronment space: %@COMMA[%_ENV]
  191.  
  192. REM {
  193. REM This where I test for DV to see if it's there...
  194. REM }
  195.  
  196. Iff "%_DV" == "1" then
  197.                         scrput 11 2 bla on Red DESQView: Present
  198.                   else
  199.                         scrput 11 2 bla on Red DESQView: Not Present
  200. scrput 12 2 bla on Red DOS Memmory: %@COMMA[%@DOSMEM[b]] Bytes free
  201. scrput 13 2 bla on Red EMS Memmory: %@COMMA[%@EMS[b]] Bytes free
  202. scrput 14 2 bla on Red XMS Memmory: %@COMMA[%@XMS[b]] Bytes free
  203.  
  204. REM {
  205. REM Ok, this is because a sort of what I view as a flaw with the SCRPUT command.
  206. REM It (SCRPUT) doesn't leave the cursor in the last written to position.  It
  207. REM will leave it in wierd places once in a while...  (Usually the top of the
  208. REM screen even though I wrote the the bottom last...oh well).  Anyways, all
  209. REM I do is take advantage of another 4DOS command (since 4DOS is the ALMIGHTY
  210. REM command processor) called the DO loop.  You programmers will know what I'm
  211. REM talking about.  All you do is something like what I have down below...  Type
  212. REM DO <Number> (there are other things you can put instead of a number, that's
  213. REM for the 4DOS doc writer to explain though...)  Then on the next line, type
  214. REM in the commands that you want it to repeat, and then type EndDo to end it
  215. REM all...  Now, back to my point, what this does is gets the cursor off the top
  216. REM of the screen so that when any prompts return they don't overwrite the
  217. REM information that I just told them...
  218. REM }
  219.  
  220. :Write_It
  221.         screen 17 0
  222.  
  223. REM {
  224. REM Alrighty, this is where I pause and let them look at the first viewing of
  225. REM the bottom window, the top 3 will stay there for a while...  Then, since
  226. REM finding out the information on their hardware takes a minute, I make it
  227. REM tell them that it is working...
  228. REM }
  229.  
  230.  
  231. REM {
  232. REM Here is an example of where I check to see wether the user wants the program
  233. REM to ask them to press a key or not
  234. REM }
  235. Iff Not "%1" == "/NoPress" then
  236.                                 Pause
  237.                            else
  238.                                 Iff not "%2" == "" then
  239.                                                         delay %2
  240.                                                    else
  241.                                                         Delay 5
  242.                                 EndIff
  243. EndIff
  244. screen 17 0 ******    Working    ******
  245.  
  246. REM {
  247. REM Ok, I've pretty much explained this one, all I do is draw the bottom window
  248. REM again on top of the "old" bottom window.  And put more variables in there
  249. REM so that you have some more to look at...
  250. REM }
  251.  
  252. REM {
  253. REM Ok, here is where the algorithm starts.  It converts the drive letter to
  254. REM a number, adds one (1) to it and then converts it back to a drive letter,
  255. REM then it checks to see if the drive is ready, if so it then continues proc-
  256. REM essing to see if it is a CD-ROM or a Physical/NetWork Hard Drive.  If
  257. REM the drive wasn't ready then it gives an error message saying that the
  258. REM drive was either not ready or not present.  It stops when there are no other
  259. REM drives to examine which is gotten from the _LASTDISK variable.  While
  260. REM examining the drive it also checks the available storage space on the drive
  261. REM and if that value is less than 2 megs a warning message is given.  It also
  262. REM tells if the drive is a boot drive using the _BOOT variable.
  263. REM }
  264.  
  265. :Wierd_Loop
  266. screen 8 0
  267. Set DRIVE=%@CHAR[%DISK%]
  268. Iff "%@Ready[%DRIVE%]" == "0" then
  269.                                         drawbox 8 1 16 78 4 bla on red fill red
  270.                                         scrput 8 4 bla on red ERROR:
  271.                                         scrput 11 24 bla on red Drive %DRIVE% not present or not ready!
  272.                                         goto Wierd_Loop_Because_I_Said
  273.                               else
  274.                                         echo.
  275. EndIff
  276. drawbox 8 1 16 78 4 bla on Red fill Red
  277. scrput 8 4 bla on Red Miscelanious info:
  278. scrput 9 2 bla on Red Free Disk Space for drive %@UPPER[%DRIVE%]: %@COMMA[%@DISKFREE[%DRIVE%,b]] Bytes
  279. scrput 10 2 bla on Red Used Disk Space for Drive %@UPPER[%DRIVE%]: %@COMMA[%@DISKUSED[%DRIVE%,b]] Bytes
  280. scrput 11 2 bla on Red Total Disk Space for Drive %@UPPER[%DRIVE%]: %@COMMA[%@DISKTOTAL[%DRIVE%,b]] Bytes
  281. Iff "%@CDROM[%DRIVE%]" == "1" then
  282.                                         scrput 12 2 bla on Red Drive %DRIVE% is a CD-ROM drive.
  283.                               else
  284.                                         Iff "%@REMOTE[%DRIVE%]" == "1" then
  285.                                                                                 scrput 12 2 bla on Red Drive %DRIVE% is a NetWork drive.
  286.                                                                        else
  287.                                                                                 Iff "%@REMOVABLE[%DRIVE%]" == "1" then
  288.                                                                                                                         scrput 12 2 bla on red Drive %DRIVE% is a removable drive.
  289.                                                                                                                   else
  290.                                                                                                                         scrput 12 2 bla on Red Drive %DRIVE% is a physical drive.
  291.                                                                                 EndIff
  292.                                         EndIff
  293. EndIff
  294. Iff "%_BOOT" == "%DRIVE" then
  295.                                 scrput 13 2 bla on red Drive %DRIVE% IS a boot drive.
  296.                           else
  297.                                 scrput 13 2 bla on red Drive %DRIVE% IS NOT a boot drive.
  298. EndIff
  299. Iff %@DISKFREE[%DRIVE%,m] lt 2 then
  300.                                         scrput 14 2 bri whi on red Drive %DRIVE% has less than 2 megabytes free!!!
  301.                                else
  302.                                         echo.
  303. EndIff
  304. :Wierd_Loop_Because_I_Said
  305. Set DISK=%@ASCII[%DRIVE%]
  306. Set DISK=%@EVAL[%DISK% + 1]
  307. Iff "%DISK" gt "%LD" Then
  308.                                 Goto End
  309.                      Else
  310.                                 Iff Not "%Working1" == "1" then
  311.                                                                 Goto Oughta_Here
  312.                                                            Else
  313.                                                                 screen 17 0
  314.                                                            Iff not "%1" == "/NoPress" then
  315.                                                                                                 screen 17 0
  316.                                                                                                 Pause
  317.                                                                                       else
  318.                                                                                                 Iff not "%2" == "" then
  319.                                                                                                                         Delay %2
  320.                                                                                                                     else
  321.                                                                                                                         Delay 5
  322.                                                                                                 EndIff
  323.                                                            EndIff
  324.                                                            Goto Oughta_Here_2
  325.                                 EndIff
  326. EndIff
  327. :Oughta_Here
  328. Set Working1=1
  329.                                 Iff Not "%1" == "/NoPress" then
  330.                                                                 screen 17 0
  331.                                                                 Pause
  332.                                                            else
  333.                                                                 Iff not "%2" == "" then
  334.                                                                                         Delay %2
  335.                                                                                    else
  336.                                                                                         Delay 5
  337.                                                                 EndIff
  338.                                 EndIff
  339. :Oughta_Here_2
  340.                                 screen 17 0 ******    Working    ******
  341.                                 Set Working=1
  342.                                 Goto Wierd_Loop
  343.  
  344. REM {
  345. REM Ok, Here I just set up a counter so that I can get out of any loops if I
  346. REM need to...  It gets UnSet before long...
  347. REM }
  348.  
  349. Goto End
  350.  
  351.  
  352. :Messed_Up
  353.  
  354. REM {
  355. REM If the program comes here then something screwed up big time!  This means
  356. REM an error level of 3.
  357. REM }
  358.  
  359. Cls Bri Red on Whi
  360. Echo FATAL ERROR ENCOUNTERED!!!
  361. Echo Reason for external program termination: %??
  362. Echo Last internal command: %_?
  363. Echo Last DOS error: %_SYSERR
  364. EndLocal
  365. GoSub Copyright
  366. Quit 3
  367.  
  368.  
  369. :Broken
  370.  
  371. REM {
  372. REM Ok, if the file makes it into this little part then something went wrong
  373. REM and they pressed CTRL-C or CTRL-BRK.  This sets an errorlevel 2
  374. REM }
  375.  
  376. Echo CTRL-C CTRL-BRK was pressed!
  377. EndLocal
  378. Gosub copyright
  379. Quit 2
  380.  
  381.  
  382. :End
  383.  
  384. REM {
  385. REM Alright, here I clean up the users environment and reset all the stuff that
  386. REM they had set, like paths and stuff...  That's what the EndLocal does...
  387. REM }
  388.  
  389. EndLocal
  390. screen 17 0
  391. GoSub CopyRight
  392. Quit 1
  393.  
  394.  
  395. :The_End
  396.  
  397. REM {
  398. REM The program should never come here, so if it does then I tell it to exit
  399. REM to produce a fatal error since something obviously screwed up.
  400. REM }
  401. Goto Messed_Up
  402.  
  403. :CopyRight
  404. screen 19 0
  405. Echo.
  406. Echo INFO.BTM v3.01a Copyright 1994,95 by Matt Walters; all rights reserved.
  407. Echo.
  408. ReTurn
  409.  
  410. REM {
  411. REM That's all folks!
  412. REM }
  413.