home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: OtherApp / OtherApp.zip / dualos2.exe / MAKESR.CMD < prev    next >
OS/2 REXX Batch file  |  1995-08-01  |  12KB  |  283 lines

  1. @echo off
  2. rem                  MAKESR.CMD     version 2.04
  3. rem This OS/2 command file creates a set of bootable floppies from a
  4. rem working OS/2 2.xx and 3.x system.  It installs drivers and utilities
  5. rem for IBM Standalone Restore (SR) system.
  6.  
  7. REM ========================================================================
  8. REM =================Version 2.04 Changes===================================
  9. REM 06/04/95
  10. REM   - Changes for Warp Connect:
  11. REM      - REM'd out statement to add basedev=print01.sys to SR disk 2 config.sys as
  12. REM        Warp Connect doesn't have this driver.
  13. REM      - Added statement to erase CMDATAPI.FLT new to Warp Connect
  14. REM      - Fixed bug that erased TOSHCDS1.EXE to TOSHCDS1.FLT
  15. REM ========================================================================
  16.  
  17. REM ========================================================================
  18. REM =================Version 2.03 Changes===================================
  19. REM 03/05/95
  20. REM   - Added CheckREXX routine to make sure REXX is installed as MakeSR is now a
  21. REM     REXX program beginning with version 2.03
  22. REM   - Added call to 2nd .cmd file which is a REXX file to get user's country code in
  23. REM      devinfo=kbd... statement from hard file config.sys
  24. REM   - Added check to look for testcfg.sys and dos.sys in both the \os2 directory
  25. REM     and the \os2\boot directory
  26. REM ========================================================================
  27.  
  28. REM ========================================================================
  29. REM =================Version 2.02 Changes===================================
  30. REM   - Added check to delete *.flt files from WARP CD-ROM SR disk #2 to make room
  31. REM ========================================================================
  32.  
  33. REM ========================================================================
  34. REM =================Version 2.01 Changes===================================
  35. REM   - Added Check for BASEDEV=IBMKBD.SYS for WARP
  36. REM   - Added Check for KBDCALLS.DLL to SR Disk #3
  37. REM   - Added Check for NLS.DLL to SR Disk #3
  38. REM ========================================================================
  39.  
  40.  
  41. echo MakeSR version 2.04
  42. echo.
  43.  
  44. rem Set up some things
  45. IF (%1) == () GOTO ParmErr
  46. IF (%2) == () GOTO ParmErr
  47.  
  48. rem cls
  49.  
  50. :CheckSystem
  51. rem Check for valid system drive
  52. if exist %1\OS2\FORMAT.COM goto :CheckREXX
  53. goto :InvalidSystem
  54.  
  55. :CheckREXX
  56. rem Check to make sure REXX is installed
  57. if exist %1\OS2\DLL\REXX.DLL goto :CheckTarget
  58. goto :NoREXX
  59.  
  60. :CheckTarget
  61. rem Check for valid floppy drive
  62. if (%2)==(A:) goto :CheckLocal
  63. if (%2)==(B:) goto :CheckLocal
  64. if (%2)==(a:) goto :CheckLocal
  65. if (%2)==(b:) goto :CheckLocal
  66. goto :InvalidTarget
  67.  
  68. :CheckLocal
  69. rem Make sure that current directory contains necessary files
  70. if exist SR.EXE goto :Begin
  71. goto :InvalidLocal
  72.  
  73. :Begin
  74.  
  75. echo ┌────────────────────────────────────────────────┐
  76. echo │                                                │
  77. echo │MakeSR version 2.04                             │
  78. echo │...................                             │
  79. echo │Install system files from drive %1              │
  80. echo │Install to Disk is %2                           │
  81. echo │                                                │
  82. echo └────────────────────────────────────────────────┘
  83. echo ┌────────────────────────────────────────────────┐
  84. echo │Insert SR DISK #2 in drive %2                   │
  85. echo └────────────────────────────────────────────────┘
  86. echo Press CTRL-C to QUIT
  87. echo          or
  88. PAUSE
  89. echo ┌────────────────────────────────────────────────┐
  90. echo │Deleting files from SR Disk #2                  │
  91. echo └────────────────────────────────────────────────┘
  92. attrib %2\config.sys -r
  93. IF EXIST %2\BUNDLE del %2\BUNDLE > nul
  94. IF EXIST %2\FIX\OS2\CSF_PROD.OS2 del %2\FIX\OS2\CSF_PROD.OS2 > nul
  95. IF EXIST %2\FIX\OS2\FILE27.___ del %2\FIX\OS2\FILE27.___ > nul
  96. IF EXIST %2\FIX\OS2\FILE1090.___ del %2\FIX\OS2\FILE1090.___ > nul
  97. IF EXIST %2\FS1.EXE del %2\FS1.EXE > nul
  98. IF EXIST %2\FService.EXE del %2\FService.EXE > nul
  99. IF EXIST %2\FService.msg del %2\FService.msg > nul
  100. IF EXIST %2\CONFIG.SYS del %2\CONFIG.SYS >nul
  101. IF EXIST %2\SYSINST1.EXE del %2\SYSINST1.EXE > nul
  102. IF EXIST %2\SYSINST2.EXE del %2\SYSINST2.EXE > nul
  103. IF EXIST %2\MOUSE.SYS del %2\MOUSE.SYS > nul
  104. IF EXIST %2\CHINCDS1.FLT del %2\CHINCDS1.FLT > nul
  105. IF EXIST %2\HITCDS1.FLT del %2\HITCDS1.FLT > nul
  106. IF EXIST %2\NECCDS1.FLT del %2\NECCDS1.FLT > nul
  107. IF EXIST %2\SONYCDS1.FLT del %2\SONYCDS1.FLT > nul
  108. IF EXIST %2\TOSHCDS1.FLT del %2\TOSHCDS1.FLT > nul
  109. IF EXIST %2\IBMIDECD.FLT del %2\IBMIDECD.FLT > nul
  110. IF EXIST %2\CMDATAPI.FLT del %2\CMDATAPI.FLT > nul
  111.  
  112.  
  113. echo ┌────────────────────────────────────────────────┐
  114. echo │Copying files to SR Disk #2                     │
  115. echo └────────────────────────────────────────────────┘
  116. copy IP22DRV.SYS %2\ >nul
  117. copy IP2XDMN.EXE %2\ >nul
  118. if exist %2\dos.sys goto :DoTestCfg
  119. if exist %1\os2\dos.sys copy %1\os2\dos.sys %2\ > nul
  120. if exist %1\os2\boot\dos.sys copy %1\os2\boot\dos.sys %2\ > nul
  121.  
  122. :DoTestCfg
  123. if exist %2\testcfg.sys goto :Cont
  124. if exist %1\os2\testcfg.sys copy %1\os2\testcfg.sys %2\ > nul
  125. if exist %1\os2\boot\testcfg.sys copy %1\os2\boot\testcfg.sys %2\ > nul
  126. :Cont
  127. echo ┌────────────────────────────────────────────────┐
  128. echo │Creating CONFIG.SYS on SR Disk #2               │
  129. echo └────────────────────────────────────────────────┘
  130. echo buffers=32 >> %2\config.sys
  131. echo iopl=yes >> %2\config.sys
  132. echo memman=noswap >> %2\config.sys
  133. echo protshell=a:\cmd.exe /k startup.cmd >> %2\config.sys
  134. echo set os2_shell=a:\cmd.exe >> %2\config.sys
  135. echo diskcache=64,LW >> %2\config.sys
  136. echo protectonly=yes >> %2\config.sys
  137. echo libpath=.;\;\os2\dll; >> %2\config.sys
  138. echo ┌────────────────────────────────────────────────┐
  139. echo │Checking for HPFS.IFS in %1\OS2 Directory       │
  140. echo └────────────────────────────────────────────────┘
  141. if exist %1\os2\hpfs.ifs echo ifs=hpfs.ifs /c:64 >> %2\config.sys
  142. echo device=ip22drv.sys >> %2\config.sys
  143.  
  144. if exist %2\dos.sys echo device=\dos.sys >> %2\config.sys
  145. echo pauseonerror=no >> %2\config.sys
  146. echo codepage=850 >> %2\config.sys
  147.  
  148. rem if rexx is not installed, write us keyboard.dcp code to config.sys, else call rexxkbd.cmd
  149. if not exist %1\OS2\DLL\REXX.DLL echo devinfo=kbd,us,keyboard.dcp >> %2\config.sys
  150. if exist %1\OS2\DLL\REXX.DLL call rexxkbd.cmd %1\config.sys %2\config.sys
  151. echo devinfo=scr,ega,vtbl850.dcp >> %2\config.sys
  152. echo set path=\;\os2;\os2\system;\os2\install >> %2\config.sys
  153. echo set dpath=\;\os2;\os2\system;\os2\install >> %2\config.sys
  154. echo set keys=on >> %2\config.sys
  155.  
  156. rem echo basedev=print01.sys >> %2\config.sys  took out when Warp Connect didn't have
  157. IF EXIST %2\ibmkbd.sys echo basedev=ibmkbd.sys >> %2\config.sys
  158. echo basedev=ibm1flpy.add >> %2\config.sys
  159. echo basedev=ibm1s506.add >> %2\config.sys
  160. echo basedev=ibm2flpy.add >> %2\config.sys
  161. echo basedev=ibm2adsk.add >> %2\config.sys
  162.  
  163. IF EXIST %2\ibm2m57.add echo basedev=ibm2m57.add >> %2\config.sys
  164. echo basedev=ibm2scsi.add >> %2\config.sys
  165. echo basedev=ibmint13.i13 >> %2\config.sys
  166. echo basedev=os2dasd.dmd >> %2\config.sys
  167.  
  168. if exist %2\testcfg.sys echo device=\testcfg.sys >> %2\config.sys
  169.  
  170. echo ┌────────────────────────────────────────────────┐
  171. echo │Creating STARTUP.CMD on SR Disk #2              │
  172. echo └────────────────────────────────────────────────┘
  173. echo @echo off > %2\startup.cmd
  174. echo @cls >> %2\startup.cmd
  175. echo type message.txt >> %2\startup.cmd
  176. echo detach ip2xdmn.exe >nul >> %2\startup.cmd
  177.  
  178. echo ┌────────────────────────────────────────────────┐
  179. echo │Creating MESSAGE.TXT on SR Disk #2              │
  180. echo └────────────────────────────────────────────────┘
  181. echo.
  182. echo ┌────────────────────────────────────────────────┐ > %2\message.txt
  183. echo │                                                │ >> %2\message.txt
  184. echo │Place SR Disk #3 in Boot Drive                  │ >> %2\message.txt
  185. echo │for the following operations:                   │ >> %2\message.txt
  186. echo │                                                │ >> %2\message.txt
  187. echo │FDISK.COM  - Partitioning disk                  │ >> %2\message.txt
  188. echo │                                                │ >> %2\message.txt
  189. echo │FORMAT.COM - High Level format                  │ >> %2\message.txt
  190. echo │                                                │ >> %2\message.txt
  191. echo │SR.EXE     - Restore your DualStor backup       │ >> %2\message.txt
  192. echo │                                                │ >> %2\message.txt
  193. echo │                                                │ >> %2\message.txt
  194. echo └────────────────────────────────────────────────┘ >> %2\message.txt
  195. echo.
  196. echo ┌────────────────────────────────────────────────┐
  197. echo │Insert SR DISK #3 in drive %2                   │
  198. echo └────────────────────────────────────────────────┘
  199. pause
  200. echo ┌────────────────────────────────────────────────┐
  201. echo │Copying files from OS/2 system directory        │
  202. echo └────────────────────────────────────────────────┘
  203. copy %1\OS2\DLL\DOSCALL1.DLL %2 > nul
  204. copy %1\OS2\DLL\VIOCALLS.DLL %2 > nul
  205. copy %1\OS2\CHKDSK.COM %2 > nul
  206. copy %1\OS2\FORMAT.COM %2\ > nul
  207. copy %1\OS2\FDISK.COM %2\ > nul
  208. if exist %1\OS2\DLL\KBDCALLS.DLL copy %1\OS2\DLL\KBDCALLS.DLL %2\ >nul
  209. if exist %1\OS2\DLL\NLS.DLL copy %1\OS2\DLL\NLS.DLL %2\ >nul
  210. echo ┌────────────────────────────────────────────────┐
  211. echo │Checking and copying HPFS files                 │
  212. echo └────────────────────────────────────────────────┘
  213. if exist %1\OS2\HPFS.IFS copy %1\OS2\HPFS.IFS %2\ >nul
  214. if exist %1\OS2\DLL\UHPFS.DLL copy %1\OS2\DLL\UHPFS.DLL %2\ >nul
  215. echo ┌────────────────────────────────────────────────┐
  216. echo │Copying files from DualStor directory           │
  217. echo └────────────────────────────────────────────────┘
  218. copy IPCRGUI.DLL %2\ >nul
  219. copy IPBB.DLL %2\ >nul
  220. copy IPBP.DLL %2\ >nul
  221. copy IPMB.DLL %2\ >nul
  222. copy IPNWUTIL.DLL %2\ >nul
  223. copy IPQUAL.DLL %2\ >nul
  224. copy IPRST.DLL %2\ >nul
  225. copy IPUCGEN.DLL %2\ >nul
  226. copy SR.EXE %2\ >nul
  227.  
  228. cls
  229. echo.
  230. echo ┌────────────────────────────────────────────────┐
  231. echo │             MakeSR Complete                    │
  232. echo └────────────────────────────────────────────────┘
  233. GOTO Done
  234.  
  235. :InvalidLocal
  236. echo This script must be run from your DualStor directory.  Change your
  237. echo working directory to the DualStor directory and run MakeSR again.
  238. echo.
  239. goto :Done
  240.  
  241. :InvalidSystem
  242. echo '%1' - Invalid system drive. Your OS/2 system drive must be specified.
  243. echo.
  244. goto :Done
  245.  
  246. :NoREXX
  247. cls
  248. echo ************************** WARNING !! ******************************
  249. echo REXX is not installed on your '%1' system drive.  Starting with MakeSR
  250. echo version 2.03 (starting with DualStor version 2.01) you need REXX installed
  251. echo for MakeSR to retrieve the correct keyboard.dcp statement from your hard
  252. echo file config.sys.  If you press any key, MakeSR will continue and SR
  253. echo disk 2 will have the statement 'devinfo=kbd,us,keyboard.dcp'.  If the
  254. echo 'us' parameter in this statement does not match your statement in your
  255. echo hard file config.sys then you must manually edit the config.sys on SR
  256. echo disk 2 to change the 'us' to your parameter before booting the SR disks.
  257. echo.
  258. echo If you do not wish to continue with MakeSR because REXX is not installed,
  259. echo simply press CTRL-C to quit MakeSR and refer to your OS/2 documentation
  260. echo on how to install REXX.
  261. echo.
  262. echo Press CTRL-C to QUIT
  263. echo          or
  264. pause
  265. goto :CheckTarget
  266.  
  267. :InvalidTarget
  268. echo '%2' - Invalid target. A floppy drive must be specified.
  269. echo.
  270. goto :Done
  271.  
  272. :ParmErr
  273. echo usage: makesr [OS/2 System Drive] [Target Floppy Drive]
  274. echo.
  275. echo For example: makesr C: A:
  276. echo.
  277. goto :Done
  278.  
  279. :Done
  280.  
  281.  
  282.  
  283.