home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / xwplascr.zip / XWPL0208.ZIP / release / bin / bm-lvm.cmd < prev    next >
OS/2 REXX Batch file  |  2000-05-23  |  2KB  |  77 lines

  1. /* Add BootManager choices to XDesktop shutdown actions */
  2. /* This will modify the XFolder INI keys in OS2.INI to  */
  3. /* contain all Bootmanager partitions as user reboot    */
  4. /* options.                                             */
  5. /* (W) (C) 1998 Duane A. Chamblee <duanec@ibm.net>      */
  6. /* Part of the XFolder package.                         */
  7.  
  8.  
  9. /**********************************************************
  10.  Modified by
  11.    Nenad Milenkovic (nenad_milenkovic@softhome.net)
  12.  
  13.  Nov 1999:
  14.    - Improved to support Logical Volume Manager output
  15.      from Warp Server for e-business (Aurora) in addition
  16.      to standard FDISK output from Warp 4
  17.  
  18.  Apr 2000:
  19.    - Updated to work with XWorkplace instead XFolder
  20.    - Improved to support bootable partitions hidden
  21.      from OS/2 (those without drive letter assigned,
  22.      Linux for example)
  23.  
  24.  Donated to XWorkplace authors to be used and released
  25.  with XWorkplace in any form and under any lincense
  26.  they wish.
  27. **********************************************************/
  28.  
  29. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  30. call SysLoadFuncs
  31.  
  32. '@call RXQUEUE.EXE /CLEAR'
  33.  
  34. if SysOS2ver()='2.45' then
  35.   do
  36.     '@call lvm /query:bootable,all 2>&1 | RXQUEUE.EXE'
  37.     ver='wseb'
  38.   end
  39. else
  40.   do
  41.     '@call fdisk /query /bootable:1 2>&1 | RXQUEUE.EXE'
  42.     ver='warp'
  43.   end
  44.  
  45. inicurrent=SysINI('USER','XFolder', 'RebootTo')
  46. if inicurrent='ERROR:' then
  47.    inistring=''
  48. else
  49.    inistring=LEFT(inicurrent,LENGTH(inicurrent)-2)
  50.  
  51. Do until LINES("QUEUE:")=0
  52.    parse value linein("QUEUE:") with oneline
  53.    if STRIP(oneline)='' then iterate
  54.  
  55.    if ver='wseb' then
  56.      do
  57.        parse var oneline drive 4 name 20 .
  58.        if POS('Bootable', oneline)\=41 then iterate
  59.      end
  60.  
  61.    if ver='warp' then
  62.      do
  63.        parse var oneline drive 7 name 15 .
  64.        if TRANSLATE(drive)='DRIVE' then iterate
  65.      end
  66.  
  67.    if POS(name,inistring)>0 then iterate
  68.    name = strip(name)
  69.    say 'adding: 'name
  70.    inistring=inistring||name||'00'x||'setboot /iba:"'||name||'"'||'00'x
  71. end
  72.  
  73. if inistring<>'' then
  74.    call SysINI 'USER','XWorkplace', 'RebootTo', inistring||'00'x||'00'x
  75.  
  76. '@call RXQUEUE.EXE /CLEAR'
  77.