home *** CD-ROM | disk | FTP | other *** search
/ MGA Millennium Bulk / BLK_5_FEB_96.iso / os2 / fixauto.cmd < prev    next >
OS/2 REXX Batch file  |  1995-03-01  |  1KB  |  48 lines

  1. /*****************/
  2. /* Get arguments */
  3. /*****************/
  4.  
  5. '@echo off'
  6.  
  7. Parse Arg all
  8.  
  9. If words(all) = 2 then do
  10.     Dstdrv = translate(word(all,1))
  11.     Action = translate(word(all,2))
  12.     end
  13. else signal ERROREXIT
  14.  
  15. /**********************************/
  16. /* add fixvga.exe to AUTOEXEC.BAT */
  17. /**********************************/
  18.  
  19. InnF=Dstdrv'\AUTOEXEC.MGA'
  20. OutF=Dstdrv'\AUTOEXEC.BAT'
  21.  
  22. 'copy 'OutF' 'InnF' >nul'
  23. 'del 'OutF
  24.  
  25. call lineout OutF, '@ECHO OFF'
  26. if Action = 'OFF' then signal REMOVEMGA
  27.  
  28. /* call lineout OutF, Dstdrv'\MGA\OS2\FIXVGA.EXE' */
  29. call lineout OutF, 'SET MGA='Dstdrv'\MGA\OS2'
  30.  
  31. REMOVEMGA:
  32.  
  33. do until lines(InnF) = 0
  34.     InStr = linein(InnF)
  35.     select
  36.         when pos('ECHO OFF', InStr) > 0         then nop
  37.         when pos('FIXVGA.EXE', InStr) > 0       then nop
  38.         when pos(':\OS2\MODE CO80', InStr) > 0  then nop
  39.         when pos('SET MGA=', InStr) > 0         then nop
  40.         otherwise call lineout OutF, InStr
  41.     end
  42. end
  43.  
  44. call stream OutF, 'c', 'close'
  45. call stream InnF, 'c', 'close'
  46.  
  47. ERROREXIT:
  48.