home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / mb211.zip / makeboot.cmd next >
OS/2 REXX Batch file  |  1994-03-13  |  11KB  |  386 lines

  1. /**********  Rexx file to make an OS/2 2.11 BOOT diskette *******/
  2. /*           MakeBoot.cmd                                       */
  3. /* trace all */
  4. /* signal on halt  name errorcleanup */
  5. /****************************************************************/
  6. /*                                                              */
  7. /* 94-03-03 RJ O'Reilly  Converted to 2.11  Version 2.11.00     */
  8. /* 94-03-10 RJ O'Reilly  Refined            Version 2.11.01     */
  9. /*                                                              */
  10. /*      Copyright 1993,1994,  R. J. O'Reilly                    */
  11. /*      OS/2 is a Trademark of IBM Corp.                        */
  12. /*                                                              */
  13. /****************************************************************/
  14.  
  15. '@echo off'
  16.  
  17. 'cls'
  18. say ""
  19. say ""
  20. say ""
  21. say ""
  22. say "      MakeBoot 2.11.01   1994-03-10 "
  23. say "      RJ O'Reilly"
  24. say "      Sherwood Park, Canada"
  25. say ""
  26. say "      OS/2 2.11 Boot Diskette creation utility."
  27. say "      This program will create a bootable 3.5 inch High Density floppy"
  28. say "      for OS/2 2.11."
  29. say ""
  30.  
  31.  
  32. cfg = "A:\config.sys"
  33. /* Load Rexx System Utility Functions  */
  34. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  35. call SysLoadFuncs                 /* RexxUtil function */
  36.  
  37. if RxFuncQuery('RexxUtil') then do
  38.     say "RexxUtil Loaded."    
  39. end
  40. else do
  41.     say "Error Loading RexxUtil Functions. Can't continue."
  42.     signal ErrorCleanup
  43. end
  44.  
  45.  
  46.  
  47. /*  First we have to sys the floppy disk */
  48.  
  49. /*  Find out if sysinstx.com is in the system directory */
  50. SysinstxOK="NO"
  51. rc=SysFileTree("c:\os2\sysinstx.com",'file','S')
  52. if rc = 0 then
  53.   if file.0<>0 then
  54.     SysinstxOK="YES"
  55.  
  56. if SysinstxOK="NO" then /* Get sysinstx.com from the installation disks */
  57. do
  58.     say "Sysinstx.com was not found! It must be loaded from the OS/2 disks."
  59.     say "Insert the 2.11 Service Pack Disk #1 into drive A:"
  60.     say "Press <enter> when ready"
  61.     rc=beep(1200,300)
  62.     pull enterkey
  63.     say "Copying sysinstx.com into the os2 install directory"
  64.     "copy  a:\sysinstx.com c:\os2\install\*.*"
  65.     if rc = 0 then do
  66.        'cls'
  67.        say ""
  68.        say ""
  69.        say "The file sysinstx.com has been copied to the install directory."
  70.        say ""
  71.        say ""
  72.        say "Remove the Service Pack Diskette form Drive A: and press <enter>"
  73.        rc=beep(1200,500)
  74.        denter=linein()
  75.     end
  76.     else
  77.     do
  78.        say "An error occurred copying sysinstx.com. Cannot continue."
  79.        say "Be sure this is the correct diskette!"
  80.        signal ErrorCleanup
  81.     end
  82. end
  83.  
  84. /* Now, is it formatted?    */
  85. say  "Is the new diskette formatted? Yes or No ?"
  86. pull formatted
  87.  
  88. if Left(formatted,1) = "N" then    /* Format the new BOOT diskette */
  89. do
  90.    say "Insert the unformatted disk into drive A:"
  91.    say "Press <enter> when ready"
  92.    pull enterkey
  93.    say "Formatting diskette in drive A:"
  94.    'format A: /ONCE'
  95.    if rc=0 then
  96.       say "Diskette in drive A: has been formatted."
  97.    else
  98.    do
  99.       say "An error occurred formatting diskette. Cannot continue."
  100.       say "It may be bad diskette."
  101.       signal ErrorCleanup
  102.    end
  103.  
  104. end
  105. else    /* They have a formatted diskette so do a quick format    */
  106. do
  107.    say "Insert the formatted disk into drive A:"
  108.    say "Press <enter> when ready"
  109.    pull enterkey
  110.    '@attrib -s -r -h a:\*.*'
  111.    '@attrib +s +r +h "a:\ea data. sf"'
  112.    say "About to delete any files on the diskette in Drive A:"
  113.    say "Verify the deletion by pressing 'Y' and then <enter>"
  114.    rc=Beep(800,500)
  115.    'ERASE A:\*.*'
  116. end
  117.  
  118. /*  Now SYS the diskette. */
  119. say "Performing a SYS to the diskette in drive A:"
  120.  
  121. 'c:\os2\install\sysinstx a:'
  122. if rc = 0 then
  123.     say "SYS complete!"
  124. else do
  125.     say "Cannot SYS the diskette in drive A:"
  126.     signal ErrorCleanup
  127. end
  128.  
  129. /* Now copy the system files to drive A:  */
  130. /**** first do the SYSTEM FILES ****/
  131. "@attrib c:\os2krnl -S -H"
  132. "copy c:\os2krnl a:\"
  133. if rc <> 0 then do
  134.    say " Error copying file. A BOOT disk was NOT created!"
  135.    "@attrib c:\os2krnl +S +H"
  136.    signal errorcopy
  137. end
  138. "@attrib c:\os2krnl +S +H"
  139. "@attrib a:\os2krnl +S +H"
  140.  
  141. "@attrib c:\os2ldr -S -H"
  142. "copy c:\os2ldr  a:\"
  143. if rc <> 0 then do
  144.    say " Error copying file. A BOOT disk was NOT created!"
  145.    "@attrib c:\os2ldr +S +H"
  146.    signal errorcopy
  147. end
  148. "@attrib c:\os2ldr +S +H"
  149. "@attrib a:\os2ldr +S +H"
  150.  
  151. "@attrib c:\os2ldr.msg -S -H"
  152. "copy c:\os2ldr.msg  a:\"
  153. if rc <> 0 then do
  154.    say " Error copying file. A BOOT disk was NOT created!"
  155.    "@attrib c:\os2ldr.msg +S +H"
  156.    signal errorcopy
  157. end
  158. "@attrib c:\os2ldr.msg +S +H"
  159. "@attrib a:\os2ldr.msg +S +H"
  160.  
  161. "copy c:\os2\ibm1flpy.add  a:\"
  162. if rc <> 0 then do
  163.    say " Error copying file. A BOOT disk was NOT created!"
  164.    signal errorcopy
  165. end
  166. /*
  167. "copy c:\os2\ibm1s506.add  a:\"
  168. if rc <> 0 then do
  169.    say " Error copying file. A BOOT disk was NOT created!"
  170.    signal errorcopy
  171. end
  172. */
  173. "copy c:\os2\chkdsk.com  a:\"
  174. if rc <> 0 then do
  175.    say " Error copying file. A BOOT disk was NOT created!"
  176.    signal errorcopy
  177. end
  178. "copy c:\os2\keyboard.dcp  a:\"
  179. if rc <> 0 then do
  180.    say " Error copying file. A BOOT disk was NOT created!"
  181.    signal errorcopy
  182. end
  183. "copy c:\os2\os2dasd.dmd  a:\"
  184. if rc <> 0 then do
  185.    say " Error copying file. A BOOT disk was NOT created!"
  186.    signal errorcopy
  187. end
  188. "copy c:\os2\cmd.exe  a:\"
  189. if rc <> 0 then do
  190.    say " Error copying file. A BOOT disk was NOT created!"
  191.    signal errorcopy
  192. end
  193. "copy c:\os2\clock01.sys  a:\"
  194. if rc <> 0 then do
  195.    say " Error copying file. A BOOT disk was NOT created!"
  196.    signal errorcopy
  197. end
  198. "copy c:\os2\kbd01.sys  a:\"
  199. if rc <> 0 then do
  200.    say " Error copying file. A BOOT disk was NOT created!"
  201.    signal errorcopy
  202. end
  203. "copy c:\os2\print01.sys  a:\"
  204. if rc <> 0 then do
  205.    say " Error copying file. A BOOT disk was NOT created!"
  206.    signal errorcopy
  207. end
  208. "copy c:\os2\screen01.sys  a:\"
  209. if rc <> 0 then do
  210.    say " Error copying file. A BOOT disk was NOT created!"
  211.    signal errorcopy
  212. end
  213. "copy c:\os2\dll\ansicall.dll  a:\"
  214. if rc <> 0 then do
  215.    say " Error copying file. A BOOT disk was NOT created!"
  216.    signal errorcopy
  217. end
  218. "copy c:\os2\dll\bkscalls.dll  a:\"
  219. if rc <> 0 then do
  220.    say " Error copying file. A BOOT disk was NOT created!"
  221.    signal errorcopy
  222. end
  223. "copy c:\os2\dll\bmscalls.dll  a:\"
  224. if rc <> 0 then do
  225.    say " Error copying file. A BOOT disk was NOT created!"
  226.    signal errorcopy
  227. end
  228. "copy c:\os2\dll\bvhinit.dll  a:\"
  229. if rc <> 0 then do
  230.    say " Error copying file. A BOOT disk was NOT created!"
  231.    signal errorcopy
  232. end
  233. "copy c:\os2\dll\bvscalls.dll  a:\"
  234. if rc <> 0 then do
  235.    say " Error copying file. A BOOT disk was NOT created!"
  236.    signal errorcopy
  237. end
  238. "copy c:\os2\dll\doscall1.dll  a:\"
  239. if rc <> 0 then do
  240.    say " Error copying file. A BOOT disk was NOT created!"
  241.    signal errorcopy
  242. end
  243. "copy c:\os2\dll\kbdcalls.dll  a:\"
  244. if rc <> 0 then do
  245.    say " Error copying file. A BOOT disk was NOT created!"
  246.    signal errorcopy
  247. end
  248. "copy c:\os2\dll\moucalls.dll  a:\"
  249. if rc <> 0 then do
  250.    say " Error copying file. A BOOT disk was NOT created!"
  251.    signal errorcopy
  252. end
  253. "copy c:\os2\dll\msg.dll  a:\"
  254. if rc <> 0 then do
  255.    say " Error copying file. A BOOT disk was NOT created!"
  256.    signal errorcopy
  257. end
  258. "copy c:\os2\dll\nampipes.dll  a:\"
  259. if rc <> 0 then do
  260.    say " Error copying file. A BOOT disk was NOT created!"
  261.    signal errorcopy
  262. end
  263. "copy c:\os2\dll\nls.dll  a:\"
  264. if rc <> 0 then do
  265.    say " Error copying file. A BOOT disk was NOT created!"
  266.    signal errorcopy
  267. end
  268. "copy c:\os2\dll\os2char.dll  a:\"
  269. if rc <> 0 then do
  270.    say " Error copying file. A BOOT disk was NOT created!"
  271.    signal errorcopy
  272. end
  273. "copy c:\os2\dll\quecalls.dll  a:\"
  274. if rc <> 0 then do
  275.    say " Error copying file. A BOOT disk was NOT created!"
  276.    signal errorcopy
  277. end
  278. "copy c:\os2\dll\sesmgr.dll  a:\"
  279. if rc <> 0 then do
  280.    say " Error copying file. A BOOT disk was NOT created!"
  281.    signal errorcopy
  282. end
  283. "copy c:\os2\dll\viocalls.dll  a:\"
  284. if rc <> 0 then do
  285.    say " Error copying file. A BOOT disk was NOT created!"
  286.    signal errorcopy
  287. end
  288. "copy c:\os2\system\harderr.exe  a:\"
  289. if rc <> 0 then do
  290.    say " Error copying file. A BOOT disk was NOT created!"
  291.    signal errorcopy
  292. end
  293. "copy c:\os2\system\country.sys  a:\"
  294. if rc <> 0 then do
  295.    say " Error copying file. A BOOT disk was NOT created!"
  296.    signal errorcopy
  297. end
  298. say "Creating the config.sys file."
  299. configstat="OK"
  300. rc = lineout(cfg,"buffers=32")
  301. if rc <>0 then configstat="NQ"
  302. rc = lineout(cfg,"iopl=yes")
  303. if rc <>0 then configstat="NQ"
  304. rc = lineout(cfg,"memman=noswap")
  305. if rc <>0 then configstat="NQ"
  306. rc = lineout(cfg,"protshell=cmd.exe")
  307. if rc <>0 then configstat="NQ"
  308. rc = lineout(cfg,"set os2_shell=cmd.exe")
  309. if rc <>0 then configstat="NQ"
  310. rc = lineout(cfg,"diskcache=64,LW")
  311. if rc <>0 then configstat="NQ"
  312. rc = lineout(cfg,"protectonly=yes")
  313. if rc <>0 then configstat="NQ"
  314. rc = lineout(cfg,"libpath=.;a:\;")
  315. if rc <>0 then configstat="NQ"
  316. rc = lineout(cfg,"pauseonerror=no")
  317. if rc <>0 then configstat="NQ"
  318. rc = lineout(cfg,"codepage=850")
  319. if rc <>0 then configstat="NQ"
  320. rc = lineout(cfg,"devinfo=kbd,us,keyboard.dcp")
  321. if rc <>0 then configstat="NQ"
  322. rc = lineout(cfg,"rem devinfo=scr,ega,vtbl850.dcp")
  323. if rc <>0 then configstat="NQ"
  324. rc = lineout(cfg,"rem device=\mouse.sys")
  325. if rc <>0 then configstat="NQ"
  326. rc = lineout(cfg,"set path=.;a:\")
  327. if rc <>0 then configstat="NQ"
  328. rc = lineout(cfg,"set dpath=a:\;")
  329. if rc <>0 then configstat="NQ"
  330. rc = lineout(cfg,"set keys=on")
  331. if rc <>0 then configstat="NQ"
  332. rc = lineout(cfg,"basedev=print01.sys")
  333. if rc <>0 then configstat="NQ"
  334. rc = lineout(cfg,"basedev=ibm1flpy.add")
  335. if rc <>0 then configstat="NQ"
  336. rc = lineout(cfg,"basedev=ibm1s506.add")
  337. if rc <>0 then configstat="NQ"
  338. rc = lineout(cfg,"basedev=os2dasd.dmd")
  339. if rc <>0 then configstat="NQ"
  340. rc = lineout(cfg,"rem device=\testcfg.sys")
  341. if rc <>0 then configstat="NQ"
  342. if configstat<>"OK" then
  343. do
  344.     say "A valid config.sys file was not created. The disk will not be a"
  345.     say "valid BOOT DISK."
  346.     signal errorcopy
  347. end
  348. else say "Config.sys file created!"
  349. say ""
  350.  
  351. signal cleanup
  352.  
  353. ErrorCopy:
  354. say "Check the diskette to be sure there were no sub-directories"
  355. say "with files in them. Also be sure you are using a High Density"
  356. say "diskette."
  357. say "If all else fails, use a new HD diskette and use the format "
  358. say "feature to  be sure the diskette is empty."
  359.  
  360. ErrorCleanup:
  361. say ""
  362. say "A valid BOOT DISKETTE was not created."
  363. signal out
  364.  
  365. Cleanup:
  366.  
  367. say ""
  368. say ""
  369. say "The OS/2 2.11 BOOT Diskette has been successfully created!"
  370. say "Enjoy!  RJ O'Reilly"
  371. say ""
  372. say "At this time it would be wise to shut down the system and attempt"
  373. say "to boot from the new BOOT diskette."
  374. say "Leave the BOOT diskette in the A: drive. Shutdown and press CTRL-ALT-DEL"
  375. say "The system should boot from the BOOT diskette."
  376. say "Press <enter> to continue."
  377. rc=Beep(1000,400)
  378.  
  379.  
  380. out:
  381. Denter=Linein()
  382.  
  383. exit
  384.  
  385.  
  386.