home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / bootfl.zip / BOOTFL.CMD
OS/2 REXX Batch file  |  1994-03-27  |  5KB  |  147 lines

  1. /* Create a bootable 3.5" floppy */
  2. /* Version: 1994 March 14 */
  3. /* Technique from Moskowitz D, Kerr D. "OS/2 Unleashed." Sams Publishing, 1993. */
  4. /* trace ?all */
  5. say "Enter the boot drive letter (e.g.: C:):"
  6. pull bootDrive .
  7. if right(bootDrive,1)\=':' then bootDrive=bootDrive':'
  8.  
  9. do forever
  10.     say "Enter 1 if your machine is ISA or EISA, or 2 if Microchannel PS/2:"
  11.     pull busType .
  12.     if busType="1" | busType="2" then leave
  13.     beep(262, 500)
  14.     say "Illegal answer!"
  15. end
  16.  
  17. do forever
  18.     say "Do you have a SCSI drive? (Y/N)"
  19.     pull scsi .
  20.     if scsi="Y" | scsi="N" then leave
  21.     beep(262, 500)
  22.     say "Illegal answer!"
  23. end
  24. if scsi="Y" then driveType="2SCSI"
  25. else driveType="1S506"
  26.  
  27. call rxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
  28. call SysLoadFuncs
  29.  
  30. workDir=SysTempFileName(bootDrive'\TEMP????')
  31. call SysMkDir(workDir)
  32. call Directory workDir
  33.  
  34. call loadDisk "Installation Diskette", "DISK 0"
  35. 'copy A:\SYSINSTX.COM .'
  36. call loadDisk "Disk 1", "DISK 1"
  37. 'copy A:\KEYBOARD.DCP .'
  38. 'copy A:\SYSINST1.EXE .'
  39.  
  40. do until answer="N"
  41.     say "Insert destination disk in drive a: and press 'ENTER'.  DISK WILL BE FORMATTED!"
  42.     pull
  43.     address cmd 'format A: /v:"OS2 BOOTDSK" /once'
  44.  
  45.     '.\sysinstx A:'
  46.  
  47.     address cmd 'attrib -h -r -s' bootDrive'\OS2KRNL'
  48.     address cmd 'attrib -h -r -s' bootDrive'\OS2LDR'
  49.     address cmd 'attrib -h -r -s' bootDrive'\OS2LDR.MSG'
  50.     address cmd 'copy' bootDrive'\OS2KRNL' 'a:\'
  51.     address cmd 'copy' bootDrive'\OS2LDR' 'a:\'
  52.     address cmd 'copy' bootDrive'\OS2LDR.MSG' 'a:\'
  53.     address cmd 'attrib +h +r +s' bootDrive'\OS2KRNL'
  54.     address cmd 'attrib +h +r +s' bootDrive'\OS2LDR'
  55.     address cmd 'attrib +h +r +s' bootDrive'\OS2LDR.MSG'
  56.  
  57.     'copy KEYBOARD.DCP A:\'
  58.     'copy SYSINST1.EXE A:\'
  59.  
  60.     address cmd 'copy' bootDrive'\OS2\DLL\ANSICALL.DLL A:\'
  61.     address cmd 'copy' bootDrive'\OS2\DLL\DOSCALL1.DLL A:\'
  62.     address cmd 'copy' bootDrive'\OS2\DLL\NLS.DLL A:\'
  63.     address cmd 'copy' bootDrive'\OS2\DLL\BKSCALLS.DLL A:\'
  64.     address cmd 'copy' bootDrive'\OS2\DLL\KBDCALLS.DLL A:\'
  65.     address cmd 'copy' bootDrive'\OS2\DLL\OS2CHAR.DLL A:\'
  66.     address cmd 'copy' bootDrive'\OS2\DLL\BMSCALLS.DLL A:\'
  67.     address cmd 'copy' bootDrive'\OS2\DLL\MOUCALLS.DLL A:\'
  68.     address cmd 'copy' bootDrive'\OS2\DLL\QUECALLS.DLL A:\'
  69.     address cmd 'copy' bootDrive'\OS2\DLL\BVHINIT.DLL A:\'
  70.     address cmd 'copy' bootDrive'\OS2\DLL\NPXEMLTR.DLL A:\'
  71.     address cmd 'copy' bootDrive'\OS2\DLL\MSG.DLL A:\'
  72.     address cmd 'copy' bootDrive'\OS2\DLL\SESMGR.DLL A:\'
  73.     address cmd 'copy' bootDrive'\OS2\DLL\BVSCALLS.DLL A:\'
  74.     address cmd 'copy' bootDrive'\OS2\DLL\NAMPIPES.DLL A:\'
  75.     address cmd 'copy' bootDrive'\OS2\DLL\VIOCALLS.DLL A:\'
  76.  
  77.     address cmd 'copy' bootDrive'\OS2\SYSTEM\HARDERR.EXE A:\'
  78.     address cmd 'copy' bootDrive'\OS2\SYSTEM\COUNTRY.SYS A:\'
  79.  
  80.     address cmd 'copy' bootDrive'\OS2\INSTALL\SYSLEVEL.OS2 A:\'
  81.  
  82.     address cmd 'copy' bootDrive'\OS2\CMD.EXE A:\'
  83.     address cmd 'copy' bootDrive'\OS2\DOS.SYS A:\'
  84.     address cmd 'copy' bootDrive'\OS2\IBMINT13.I13 A:\'
  85.     address cmd 'copy' bootDrive'\OS2\OS2DASD.DMD A:\'
  86.     address cmd 'copy' bootDrive'\OS2\HPFS.IFS A:\'
  87.     address cmd 'copy' bootDrive'\OS2\CHKDSK.COM A:\'
  88.  
  89.     address cmd 'copy' bootDrive'\OS2\CLOCK0'busType'.SYS A:\'
  90.     address cmd 'copy' bootDrive'\OS2\KBD0'busType'.SYS A:\'
  91.     address cmd 'copy' bootDrive'\OS2\PRINT0'busType'.SYS A:\'
  92.     address cmd 'copy' bootDrive'\OS2\SCREEN0'busType'.SYS A:\'
  93.     address cmd 'copy' bootDrive'\OS2\IBM'busType'FLPY.ADD A:\'
  94.     if busType="2" then 'echo . > A:\ABIOS.SYS'
  95.  
  96.     address cmd 'copy' bootDrive'\OS2\IBM'driveType'.ADD A:\'
  97.  
  98.     call LineOut 'A:\CONFIG.SYS','IFS=HPFS.IFS /CACHE:64'
  99.     call LineOut 'A:\CONFIG.SYS','BUFFERS=32'
  100.     call LineOut 'A:\CONFIG.SYS','IOPL=YES'
  101.     call LineOut 'A:\CONFIG.SYS','MEMMAN=NOSWAP'
  102.     call LineOut 'A:\CONFIG.SYS','PROTSHELL=SYSINST1.EXE'
  103.     call LineOut 'A:\CONFIG.SYS','SET OS2_SHELL=CMD.EXE'
  104.     call LineOut 'A:\CONFIG.SYS','DISKCACHE=64,LW'
  105.     call LineOut 'A:\CONFIG.SYS','PROTECTONLY=YES'
  106.     call LineOut 'A:\CONFIG.SYS','LIBPATH=.;\;'
  107.     call LineOut 'A:\CONFIG.SYS','PAUSEONERROR=NO'
  108.     call LineOut 'A:\CONFIG.SYS','CODEPAGE=850'            /* Change for different country */
  109.     call LineOut 'A:\CONFIG.SYS','DEVINFO=KBD,US,KEYBOARD.DCP'    /* Change for different country */
  110.     call LineOut 'A:\CONFIG.SYS','DEVICE=\DOS.SYS'
  111.     call LineOut 'A:\CONFIG.SYS','SET PATH=.;\'
  112.     call LineOut 'A:\CONFIG.SYS','SET DPATH=\;'
  113.     call LineOut 'A:\CONFIG.SYS','SET KEYS=ON'
  114.     call LineOut 'A:\CONFIG.SYS','BASEDEV=PRINT0'busType'.SYS'
  115.     call LineOut 'A:\CONFIG.SYS','BASEDEV=IBM'busType'FLPY.ADD'
  116.     call LineOut 'A:\CONFIG.SYS','BASEDEV=IBMINT13.I13'
  117.     call LineOut 'A:\CONFIG.SYS','BASEDEV=OS2DASD.DMD'
  118.     call LineOut 'A:\CONFIG.SYS','BASEDEV=IBM'driveType'.ADD'
  119.  
  120.     do forever
  121.         say 'Create another boot disk? (Y/N)'
  122.         pull answer
  123.         if answer="Y" | answer="N" then leave
  124.         beep(262, 500)
  125.         say "Illegal answer!"
  126.     end
  127. end
  128.  
  129. 'cmd /c del *.* /n'            /* Must use cmd, not 4os2 */
  130. address cmd 'cmd.exe /c' bootDrive
  131. call Directory('\');
  132. address cmd 'rmdir' workDir
  133.  
  134. exit
  135.  
  136. loadDisk:
  137. do forever
  138.     say "Insert" arg(1) "in drive a: and press 'ENTER'"
  139.     pull
  140.     driveInfo=SysDriveInfo('A:')
  141.     parse var driveInfo . . . label
  142.     if label=arg(2) then leave
  143.     beep(262, 100)
  144.     say "Incorrect disk!"
  145. end
  146. return
  147.