home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / os2cp210.zip / OS2COPY2.CMD < prev    next >
OS/2 REXX Batch file  |  1994-05-22  |  22KB  |  635 lines

  1. /*
  2. ┌───────────────────────────────────────────────────────────────────────┐
  3. │ OS2Copy2.CMD v.2.1.02 GA part 2 of 2.                                 │
  4. │                                                                       │
  5. │ REXX script to copy OS/2 2.1 GA HPFS or FAT BootManager system,       │
  6. │ from one drive letter to another  eg. from D: to E:,                  │
  7. │ from FAT to FAT, HPFS to HPFS.                                        │
  8. │                                                                       │
  9. │ Documentation is found in the file OS2COPY.DOC                        │
  10. │                                                                       │
  11. │ Copyright (C): John Ståhle                                            │
  12. │                289A Buddinge Hovedgade                                │
  13. │                DK-2880 Bagsværd                                       │
  14. │                Denmark, Europe                                        │
  15. │                Phone +45 44 98 66 18                                  │
  16. │                                                                       │
  17. │                Internet:            john.staahle@dkb.dk               │
  18. │                RIME and ILINK OS/2: John Staahle                      │
  19. │                                                                       │
  20. │ Disclaimer, warning and what not:                                     │
  21. │ !! NO responsibility or any other obligation you can ever think of    │
  22. │    is assumed, honored or anything else.                              │
  23. └───────────────────────────────────────────────────────────────────────┘ 
  24. */
  25.  
  26. Call RxFuncAdd SysLoadFuncs, RexxUtil, SysLoadFuncs
  27. CALL SysLoadFuncs
  28.  
  29. PARSE UPPER Arg all_args
  30.  
  31. HPFSSys = 'HPFS' 
  32. FATSys  = 'FAT'
  33.  
  34. '@ECHO OFF'
  35. 'Set PROMPT=$E[1;33m$P$G'
  36. Call SysCLS
  37. CALL StartMelding
  38.  
  39. CALL HentParametre
  40. IF (FromDrive==ToDrive) THEN DO
  41.    CALL FromSameAsTo
  42.    CALL HentParametre
  43.    IF (FromDrive==ToDrive) THEN DO
  44.       CALL FromSameAsTo
  45.       EXIT
  46.    END
  47.    CALL SysCls
  48. END
  49. ToSubDir   = SUBSTR(FromDrive,1,1)
  50. ToLetter   = SUBSTR(ToDrive,1,1)
  51. ToLocation = ToDrive'\'ToSubDir
  52. FromDrive
  53.  
  54. CALL FindFiler
  55. CALL GetYesNo
  56. CALL GetXCopSw
  57. CALL AskCreate 
  58. IF (OK \= YesLetter) THEN DO
  59.    'FDISK'
  60.    CALL AskCreate 
  61.    IF (OK \= YesLetter) THEN DO
  62.       SAY
  63.       SAY 'It is impossible to copy OS/2 without a bootable partition on 'ToDrive
  64.       SAY
  65.       EXIT
  66.    END
  67. END
  68. CALL SysCls
  69.  
  70. CALL Kopimeddelelse
  71. CALL SetERMSG
  72.  
  73. /* Here goes */
  74.  
  75. CALL DiskFormat
  76. CALL CheckFreeBefore
  77. CALL MakeDirs
  78. Call SysCLS
  79. SAY '┌────────────────────────────────────────────────────────────────┐'
  80. SAY '│                                                                │'
  81. SAY '│  OS2Copy2 v.2.1.02 GA Copyright (c) 1992-1994: John Ståhle     │'
  82. SAY '│                                                                │'
  83. SAY '│  Working  -  do NOT touch !!!  Do NOT start other sessions !!! │'
  84. SAY '│                                                                │'
  85. SAY '└────────────────────────────────────────────────────────────────┘'
  86. 'XCOPY 'FromDrive'\*.* 'ToDrive'\ 'XcopSw' /S /E 1>NUL 2>&1'
  87. CALL FixNotCopy
  88. CALL RetEAs
  89. IF ((FromFilSys==FATSys) & (ToFilSys==HPFSSys)) THEN DO
  90.    CALL TilNytFilSystem
  91. END
  92. CALL CopyInitFilesToNewDrive
  93. CALL CopyBinFiles
  94. CALL CopyTextFiles
  95. CALL LineOut(cInitList)
  96. InitEditExe' 'FromDrive' 'ToDrive' 'cInitLis2' 'InitEditExe
  97. CALL CopyInitFilesToInstall
  98. CALL CopyTextFilesToInstall
  99. CALL LineOut(cInitList)
  100. DROP cInitList
  101. CALL OKMelding
  102. CALL CleanUp
  103. CALL SlutMelding
  104. ToDrive
  105. 'CD OS2'
  106. 'SetBoot /B 1>NUL 2>&1'
  107.  
  108. /*  EXIT  */
  109. /*───────────────────────────────────────────────────────────────────────*/
  110.  
  111. GetYesNo:
  112.    YesNo = ' '
  113.    DO WHILE (SubStr(YesNo,2,1) \= '/')
  114.       YesNo = LineIn(YesNoFile)
  115.    END
  116.    YesLetter = SubStr(YesNo,1,1)
  117.    NoLetter  = SubStr(YesNo,3,1)
  118.    IF (YesLetter == ' ') THEN YesLetter = 'Y'
  119.    IF (NoLetter  == ' ') THEN NoLetter  = 'N'
  120.    CALL LineOut(YesNoFile)
  121. RETURN
  122.  
  123. /*.......................................................................*/
  124.  
  125. GetXCopSw:
  126.    XCopSw = ' '
  127.    DO WHILE (SubStr(XCopSw,2,1) \= '/')
  128.       XCopSw = LineIn(XCopSwFile)
  129.    END
  130.    IF (XCopSw == ' ') THEN XCopSw = ' /E /H /T /R /V'
  131.    CALL LineOut(XCopSwFile)
  132. RETURN
  133.  
  134. /*.......................................................................*/
  135.  
  136. FindFiler:
  137.  
  138.    InitEditFil = 'InitEdit.EXE'
  139.    InitEditExe = SysSearchPath('PATH',InitEditFil)
  140.    IF (InitEditExe=='') then DO
  141.       NoFileName = InitEditFil
  142.       CALL FileNotThere
  143.       CALL GoodBye
  144.       EXIT
  145.    END
  146.    
  147.    InitEditList = 'InitEdit.LST'
  148.    cInitList    = SysSearchPath('PATH',InitEditList)
  149.    IF (cInitList=='') then DO
  150.       NoFileName = InitEditList
  151.       CALL FileNotThere
  152.       CALL GoodBye
  153.       EXIT
  154.    END
  155.    cInitLis2 = SubStr(cInitList,1,LastPos('.',cInitList))||'LS2'
  156.  
  157.    YesNoFil  = 'YesNo.LNG'
  158.    YesNoFile = SysSearchPath('PATH',YesNoFil)
  159.    IF (YesNoFile=='') then DO
  160.       NoFileName = YesNoFil
  161.       CALL FileNotThere
  162.       CALL GoodBye
  163.       EXIT
  164.    END
  165.    
  166.    IF ((FromFilSys==FATSys) & (ToFilSys==HPFSSys)) THEN DO
  167.       BootStrap = 'BOOT21.'SubStr(HPFSSys,1,3)
  168.       CopyBootStrap = SysSearchPath('PATH',BootStrap)
  169.       IF (CopyBootStrap=='') then DO
  170.          NoFileName = YesNoFil
  171.          CALL FileNotThere
  172.          CALL GoodBye
  173.          EXIT
  174.       END
  175.    END
  176.    
  177.    XCopSwFil  = 'XCopy.Sw'
  178.    XCopSwFile = SysSearchPath('PATH',XCopSwFil)
  179.    IF (XCopSwFile=='') then DO
  180.       NoFileName = XCopSwFile
  181.       CALL FileNotThere
  182.       'PAUSE'
  183.    END
  184.  
  185. RETURN
  186.  
  187. /*.......................................................................*/
  188. HentParametre:
  189.    
  190. ArgNo = 1
  191. /* 'OS2Copy <FromDrive>[:]  <ToDrive>[:] [<To file system>]' */
  192.  
  193. CALL HentFraParametre
  194. CALL HentTilParametre
  195.  
  196. RETURN
  197.  
  198. /*.......................................................................*/
  199. HentFraParametre:
  200.    k=SysCurPos()
  201.    FromDrive=word(all_args,ArgNo)
  202.    DO WHILE (FromDrive=='')
  203.       CALL SysCurPos word(k,1), 0
  204.       SAY 'Partition to copy OS/2 system FROM (X:) ?'
  205.       CALL SysCurPos word(k,1), 48
  206.       PULL FromDrive
  207.    END
  208.    IF (SUBSTR(FromDrive,2,1)<>':') THEN FromDrive = FromDrive':'
  209.  
  210.    'FDISK /Query |'RxQueue
  211.    DO WHILE (QUEUED() > 0)
  212.       PARSE PULL cFilSysInfo
  213.       IF (SubStr(cFilSysInfo,19,2)==FromDrive) THEN DO
  214.          IF (SubStr(cFilSysInfo,30,2)=='07') THEN FromFilSys = HPFSSys
  215.          IF (SubStr(cFilSysInfo,30,2)=='06') THEN FromFilSys = FATSys
  216.       END
  217.    END
  218. RETURN
  219.  
  220. /*.......................................................................*/
  221. HentTilParametre:
  222.    ArgNo   = ArgNo + 1
  223.    ToDrive = word(all_args,ArgNo)
  224.    k=SysCurPos()
  225.    DO WHILE (ToDrive=='')
  226.       CALL SysCurPos word(k,1), 0
  227.       SAY 'Hard drive to copy your OS/2 system TO  (X:) ?'
  228.       PULL ToDrive 
  229.    END
  230.    IF (SUBSTR(ToDrive,2,1) \= ':') THEN ToDrive = ToDrive':'
  231.    
  232.    ArgNo     = ArgNo + 1
  233.    ToFilSys = word(all_args,ArgNo)
  234.    IF (ToFilSys=='') THEN DO
  235.       ToFilSys = FromFilSys
  236.    END
  237.    ELSE DO
  238.       IF (substr(ToFilSys,1,1) == substr(FATSys,1,1))  THEN ToFilSys = FATSys
  239.       IF (substr(ToFilSys,1,1) == substr(HPFSSys,1,1)) THEN ToFilSys = HPFSSys
  240.    END
  241. RETURN
  242.  
  243. /*.......................................................................*/
  244. SelectBootStrap:
  245. RETURN
  246.  
  247. /*.......................................................................*/
  248. DiskFormat:
  249.    'FDISK /Query |'RXQueue
  250.    FilSysInfo.0 = QUEUED()
  251.    DO i = 1 TO FilSysInfo.0
  252.       PARSE PULL FilSysInfo.i
  253.       IF (SubStr(FilSysInfo.i,19,2)==FromDrive) THEN DO
  254.          IF (SubStr(FilSysInfo.i,30,2)=='07') THEN FromFilSys = HPFSSys
  255.          IF (SubStr(FilSysInfo.i,30,2)=='06') THEN FromFilSys = FATSys
  256.       END
  257.    END
  258.          SAY '┌───────────────────────────────────────────────────────────────────────┐'
  259.          SAY '│ If, for some reason, the format does not work:                        │' 
  260.          SAY '│ 1. Press Ctrl C to STOP.                                              │' 
  261. IF (FromFilSys == HPFSSys) THEN DO                                        
  262.          SAY "│ 2. Perform format "ToDrive" /FS:"FromFilSys" 'by hand', giving NO label              │"
  263.          /* SAY "│ 2. Perform format x: /FS:HPFS by hand, giving NO label              │" */
  264. END
  265. ELSE DO
  266.    IF (ToFilSys == FromFilSys) THEN DO
  267.          SAY "│ 2. Perform format "ToDrive" /FS:"FromFilSys" 'by hand', giving NO label               │"
  268.          /* SAY "│ 2. Perform format x: /FS:FAT by hand, giving NO label               │" */
  269.    END
  270.    ELSE DO
  271.       IF (ToFilSys == HPFSSys) THEN DO                                        
  272.          SAY "│ 2. Perform format "ToDrive" /FS:"ToFilSys" 'by hand', giving NO label              │"
  273.          /* SAY "│ 2. Perform format x: /FS:HPFS by hand, giving NO label              │" */
  274.       END
  275.    END
  276. END
  277.          SAY '│ 3. Shut down and restart the computer.                                │'
  278.          SAY '└───────────────────────────────────────────────────────────────────────┘'
  279. SAY
  280.    
  281. IF (FromFilSys==ToFilSys) THEN DO
  282.    'Echo 'YesLetter'|Format 'ToDrive' /FS:'FromFilSys' /V:'ToLetter'OS2'FromFilSys
  283. END
  284. ELSE DO
  285.    'Echo 'YesLetter'|Format 'ToDrive' /FS:'ToFilSys' /V:'ToLetter'OS2'ToFilSys
  286. END
  287. RETURN
  288.  
  289. /*.......................................................................*/
  290. CheckFreeBefore:
  291. CALL CheckFree
  292. IF (ToFree < FromUsed) THEN DO
  293.  CALL SysCls
  294.  SAY
  295.  SAY '┌─────────────────────────────────────────────────────────────┐'
  296.  SAY '│                                                             │'
  297.  SAY '│  Drive 'FromDrive' contains          'FORMAT(FromUsed,8,0)' KB files etc.         │'
  298.  SAY '│  Drive 'ToDrive' has room for only 'FORMAT(ToFree,8,0)' KB                    │'
  299.  SAY '│                                                             │'
  300.  SAY '│  There is NOT room enough for a copy of 'FromDrive' on 'ToDrive'            │'
  301.  SAY '│                                                             │'
  302.  SAY '│  Now is the time to remove superfluous files on 'ToDrive'          │'
  303.  SAY '│  using a different thread                                   │'
  304.  SAY '│                                                             │'
  305.  SAY '└─────────────────────────────────────────────────────────────┘'
  306.  SAY
  307.  SAY 'Press CTRL C to stop or'
  308.  'PAUSE'
  309. END
  310. RETURN
  311.  
  312. /*.......................................................................*/
  313.  
  314. CheckFreeAfter:
  315.  
  316. SwapSize = 0
  317.    InitSize = 0
  318.    FromInis = FromDrive'\OS2\*.INI'
  319.    rc = SysFileTree(FromInis,'InitFiles.','F')
  320.    IF (InitFiles.0 > 0) THEN DO i = 1 TO InitFiles.0
  321.       InitSize = InitSize + WORD(InitFiles.i,3)
  322.    END
  323.    ELSE DO
  324.       InitSize = 1000
  325.    END
  326.    InitSize = (InitSize * 1.2 + SwapSize) /1024
  327.    CALL CheckFree
  328.  IF (ToFree < InitSize) THEN DO
  329.   CALL SysCls
  330.   SAY
  331.   SAY 'Drive 'FromDrive' contains          'FORMAT(InitSize,8,0)' KB init files'
  332.   SAY 'Drive 'ToDrive' has room for only 'FORMAT(ToFree,8,0)' KB'
  333.   SAY 'There is NOT room enough for a copy of 'FromDrive' on 'ToDrive
  334.   SAY
  335.   SAY '┌─────────────────┐'
  336.   SAY '│    Aborting     │'
  337.   SAY '└─────────────────┘'
  338.   CALL CleanUp
  339.   EXIT
  340.  END     
  341. RETURN
  342.  
  343. /*.......................................................................*/
  344.  
  345. CheckFree:
  346.    FromInfo  = SysDriveInfo(FromDrive)
  347.    FromTotal = SUBWORD(FromInfo,3,1)/1024
  348.    FromFree  = SUBWORD(FromInfo,2,1)/1024
  349.    FromUsed  = FromTotal - FromFree
  350.     
  351.    ToInfo    = SysDriveInfo(ToDrive)
  352.    ToFree    = SUBWORD(ToInfo,2,1)/1024
  353. RETURN
  354.  
  355. /*.......................................................................*/
  356. TilNytFilSystem:
  357.    BootStrap =  ToDrive'\OS2BOOT.'
  358.    'Attrib -H -R -S 'BootStrap
  359.    'COPY 'CopyBootStrap' 'BootStrap
  360.    'Attrib +H +R +S 'BootStrap
  361. RETURN
  362.  
  363. /*.......................................................................*/
  364. CopyInitFilesToNewDrive:
  365. CALL SysCls
  366. SAY '┌─────────────────────────────────────────────────────────────┐'
  367. SAY '│                                                             │'
  368. SAY '│  Now is the time to shut down ALL OTHER processes           │'
  369. SAY '│                                                             │'
  370. SAY '└─────────────────────────────────────────────────────────────┘'
  371. 'PAUSE'
  372.    CALL CheckFreeAfter
  373.    CALL MakeDirs
  374.    CALL InitCopyMelding
  375.    cInitFil = LineIn(cInitList,1,1)
  376.    DO WHILE (cInitFil \= '>INIT_FILES')
  377.       cInitFil = LineIn(cInitList)
  378.    END
  379.    cInitFil = LineIn(cInitList)
  380.    DO WHILE ((cInitFil \= '>BIN_FILES') & (LEFT(cInitFil,1)=='\'))
  381.       IndIni = FromDrive'\OS2'cInitFil
  382.       UdIni  = ToLocation||cInitFil
  383.       SAY 'Working on 'IndIni
  384.       'Attrib -R 'UdIni' 1>NUL 2>&1'
  385.       'Echo N|XCOPY 'IndIni' 'UdIni' 'XCopSw' 1>NUL 2>&1'
  386.       'Attrib -R 'UdIni' 1>NUL 2>&1'
  387.       cInitFil = LineIn(cInitList)
  388.    END
  389.    CALL OKForFileNotFound
  390.    'Attrib -R 'ToDrive'\OS2\OS2*.!!! 1>NUL 2>&1'
  391.    'DEL 'ToDrive'\OS2\OS2*.!!! 1>NUL 2>&1'
  392.    'Attrib -R 'ToDrive'\OS2\OS2*.INI 1>NUL 2>&1'
  393. RETURN
  394.  
  395. /* .....................................................................*/
  396.  
  397. CopyInitFilesToInstall:
  398.    cInitFil = LineIn(cInitList,1,1)
  399.    DO WHILE cInitFil  \=  '>INIT_FILES'
  400.       cInitFil = LineIn(cInitList)
  401.    END
  402.  
  403.    DO WHILE (cInitFil \= '>BIN_FILES')
  404.       cInitFil = LineIn(cInitList)
  405.       DO WHILE (substr(cInitFil,1,1)=='\')
  406.          'XCOPY 'ToDrive'\OS2'cInitFil ToDrive'\OS2\INSTALL 'XCopSw' 1>NUL 2>&1'
  407.          cInitFil = LineIn(cInitList)
  408.       END
  409.    END
  410. RETURN
  411.  
  412. /*.......................................................................*/
  413.  
  414. CopyBinFiles:
  415.    DO WHILE (BinFil \= '>TXT_FILES')
  416.       BinFil = LineIn(cInitList)
  417.       DO WHILE (substr(BinFil,1,1)=='\')
  418.          'Attrib -R 'ToDrive||BinFil' 1>NUL 2>&1'
  419.          'DEL 'ToDrive||BinFil' 1>NUL 2>&1'
  420.          'XCOPY 'FromDrive||BinFil ToLocation' 'XCopSw' 1>NUL 2>&1'
  421.          BinFil = LineIn(cInitList)
  422.       END
  423.    END
  424. RETURN
  425.  
  426. /*.......................................................................*/
  427.  
  428. CopyTextFiles:
  429.    DO WHILE (TxtFil \= '>>>THE_END')
  430.       TxtFil = LineIn(cInitList)
  431.       DO WHILE (substr(TxtFil,1,1)=='\')
  432.          'XCOPY 'FromDrive||TxtFil' 'ToLocation' 'XCopSw' 1>NUL 2>&1'
  433.          TxtFil = LineIn(cInitList)
  434.       END
  435.    END
  436. RETURN
  437.  
  438. /*.......................................................................*/
  439.  
  440. CopyTextFilesToInstall:
  441.    DO WHILE (TxtFil \= '>>>THE_END')
  442.       TxtFil = LineIn(cInitList)
  443.       DO WHILE (substr(TxtFil,1,1)=='\')
  444.          'XCOPY 'ToDrive||TxtFil' 'ToDrive'\OS2\INSTALL 'XCopSw' 1>NUL 2>&1'
  445.          TxtFil = LineIn(cInitList)
  446.       END
  447.    END
  448. RETURN
  449.  
  450. /*.......................................................................*/
  451.  
  452. CleanUp:
  453.    'Copy 'Fromdrive'\Startup.@#@ 'Fromdrive'\Startup.Cmd 1>NUL 2>&1'
  454.    'Copy 'ToDrive'\StartUp.@#@   'ToDrive'\Startup.Cmd 1>NUL 2>&1'
  455.    'DEL  'Fromdrive'\Startup.@#@'
  456.    'DEL  'Todrive'\Startup.@#@'
  457. RETURN
  458.  
  459. /*.......................................................................*/
  460. DeleteError:
  461.    PROCEDURE EXPOSE rc cDummy cERMSG rcError
  462.    SAY 'Delete 'cDummy
  463.    IF (rc <= rcError.0) THEN DO
  464.       SAY rcError.rc' 'cERMSG
  465.    END    
  466.    ELSE DO
  467.       SAY rcError.1
  468.    END    
  469. RETURN
  470.  
  471. /*.......................................................................*/
  472.  
  473. StartMelding:
  474. SAY '┌───────────────────────────────────────────────────────────────────────────┐'
  475. SAY '│                                                                           │'
  476. SAY '│ OS2Copy2 v.2.1.02 GA Copyright (c) 1992-1994: John Ståhle                 │'
  477. SAY '│ This OS2Copy script is placed in the Public Domain                        │'
  478. SAY '│                                                                           │'
  479. SAY '└───────────────────────────────────────────────────────────────────────────┘'
  480. SAY '┌───────────────────────────────────────────────────────────────────────────┐'
  481. SAY '│ Wait for the system to stabilize (no disk activity) before you continue!  │'
  482. SAY '└───────────────────────────────────────────────────────────────────────────┘'
  483. RETURN
  484.  
  485. /*.......................................................................*/
  486.  
  487. InitCopyMelding:
  488. SAY '┌───────────────────────────────────────────────────────────────────────────┐'
  489. SAY '│                                                                           │'
  490. SAY '│  Copying .INI files in progress.                                          │'
  491. SAY '│                                                                           │'
  492. SAY '└───────────────────────────────────────────────────────────────────────────┘'
  493. RETURN
  494.  
  495. /*.......................................................................*/
  496.  
  497. FileNotThere:
  498.    SAY '   ┌───────────────────────────────────────────────────────────────────┐'
  499.    SAY '   │' NoFileName' was >> NOT <<  found in your path'
  500.    SAY '   │' NoFileName' is crucial for the success of this procedure'
  501.    SAY '   │ !!! Path to 'NoFileName' must be included in your Config.Sys   !!!'
  502.    SAY '   │ !!! Path to 'NoFileName' must be included in your Autoexec.Bat !!!'
  503.    SAY '   └───────────────────────────────────────────────────────────────────┘'
  504. RETURN
  505.  
  506. /*.......................................................................*/
  507.  
  508. FromSameAsTo:
  509. SAY '┌─────────────────────────────────────────────────────────────────────────┐'
  510. SAY '│                                                                         │'
  511. SAY '│    FromDrive ('FromDrive') is the same as ToDrive ('ToDrive') NO GO!                    │'
  512. SAY '│                                                                         │'
  513. SAY '└─────────────────────────────────────────────────────────────────────────┘'
  514.    'PAUSE'
  515.    CALL SysCls
  516. RETURN
  517.  
  518. /*.......................................................................*/
  519.  
  520. Kopimeddelelse:
  521. SAY '┌───────────────────────────────────────────────────────────────────────┐'
  522. SAY '│                                                                       │'
  523. SAY '│ Copying OS/2 'FromDrive' -----> 'ToDrive'                                             │'
  524. SAY '│                                                                       │'
  525. SAY '└───────────────────────────────────────────────────────────────────────┘'
  526. IF ((ToFilSys\='') & (FromFilSys\=ToFilSys)) THEN DO
  527.    SAY '┌───────────────────────────────────────────────────────────────────────┐'
  528.    SAY '│ Copying OS/2 'FromFilSys'  ----->  'ToFilSys'                                        │'
  529.    SAY '└───────────────────────────────────────────────────────────────────────┘'
  530. END
  531. RETURN
  532.  
  533. /*.......................................................................*/
  534. SetERMSG:
  535.    rcError.1  = 'Other file error'
  536.    rcError.2  = 'File not found'
  537.    rcError.3  = 'Path not found'
  538.    rcError.4  = 'Unknown error'
  539.    rcError.5  = 'Access denied'
  540.    rcError.0  = 5
  541. RETURN
  542.  
  543. /*.......................................................................*/
  544.  
  545. AskCreate:
  546. SAY '┌───────────────────────────────────────────────────────────────────────────┐'
  547. SAY '│                                                                           │'
  548. SAY '│ Do you already have a bootable partition on 'ToDrive' or                         │'
  549. k = SysCurPos()                                                              
  550. SAY '│ did you create one and insert it in BootManager                           │'
  551. SAY '│                                                                           │'
  552. SAY '└───────────────────────────────────────────────────────────────────────────┘'
  553.    p = SysCurPos()                                                              
  554.    OK = ''
  555.    DO WHILE ((OK \= YesLetter) & (OK \= NoLetter))
  556.       CALL SysCurPos word(k,1),60
  557.       SAY '('YesNo')?'
  558.       CALL SysCurPos word(k,1),67
  559.       JaNej = SysGetKey()
  560.       PARSE UPPER VAR JaNej OK
  561.    END
  562.    CALL SysCurPos word(p,1),0
  563. RETURN
  564.  
  565. /*.......................................................................*/
  566. OKForFileNotFound:
  567. SAY
  568. SAY 'SYSxxxx: The system cannot find the file specified.'
  569. SAY '              is >>> OK <<<'
  570. SAY 
  571. RETURN
  572.  
  573. /*.......................................................................*/
  574.  
  575. MakeDirs:
  576. SAY
  577. SAY 'SYSxxxx: A subdirectory or file 'ToLocation' already exists.'
  578. SAY 'SYSxxxx: A subdirectory or file 'ToDrive'\OS2 already exists.'
  579. SAY
  580. SAY '             are >>>  OK  <<<'
  581. SAY
  582.   
  583. 'MD 'ToLocation
  584. 'MD 'ToDrive'\OS2'
  585. RETURN
  586.  
  587. /*.......................................................................*/
  588. RetEAs:
  589. RETURN
  590.  
  591. /*.......................................................................*/
  592. GoodBye:
  593.    SAY 'Mission impossible. Good-bye, cruel world'
  594.    CALL CleanUp
  595. RETURN
  596.  
  597. /* .....................................................................*/
  598.  
  599. OKMelding:
  600. SAY
  601. SAY 'A backup of original files is left in subdirectory 'ToLocation
  602. CALL OKForFileNotFound
  603. SAY 'This just tells that originally you did not have no STARTUP.CMD'
  604. SAY
  605. RETURN
  606.  
  607. /*.......................................................................*/
  608. Slutmelding:
  609. SAY '┌──────────────────────────────────────────────┐'
  610. SAY '│                                              │'
  611. SAY '│ Now you are about to warm-boot your computer │'
  612. SAY '│         from your new copy of OS/2           │'
  613. SAY '│                                              │'
  614. SAY '└──────────────────────────────────────────────┘'
  615. RETURN
  616.  
  617. /*.......................................................................*/
  618. FixNotCopy:
  619.    NotCopyFil  = 'Not_Copy.Lst'
  620.    NotCopyFile = SysSearchPath('PATH',NotCopyFil)
  621.    IF (NotCopyFile\='') then DO
  622.       cNotCopy = LineIn(NotCopyFile,1,1)
  623.       DO WHILE (SubStr(cNotCopy,1,1) == '/')
  624.          cNotCopy = LineIn(NotCopyFile)
  625.       END
  626.       DO WHILE (SubStr(cNotCopy.i,1,1) == '\')
  627.          'Attrib -H -R -S "'ToDrive||cNotCopy'" 1>NUL 2>&1'
  628.          'DEL "'ToDrive||cNotCopy'" 1>NUL 2>&1'
  629.          cNotCopy = LineIn(NotCopyFile)
  630.       END
  631.    END
  632. RETURN
  633.  
  634. /*───────────────────────────────────────────────────────────────────────*/
  635.