home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / sortboot.zip / SORTBOOT.CMD < prev   
OS/2 REXX Batch file  |  1997-06-26  |  3KB  |  100 lines

  1. /* Sort config.sys for speed                */
  2. /* Author: J. Pedone (jpedone@flash.net)    */
  3. /* Legal Stuff:                             */
  4. /*     It's free - you get what you pay for */
  5.  
  6. /* Load the REXX functions */
  7. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  8. call SysLoadFuncs
  9.  
  10. /* set up carraige return, tab and pull in the drive letter */
  11. OPTIONS 'EXMODE'
  12.  
  13. cr='0d'x
  14. lf='0a'x
  15. tab = '09'x
  16. ARG drive,1
  17.  
  18. rc = SysSearchPath('.' , 'config.new')
  19. if rc <> ' ' THEN
  20.         DO
  21.                 SAY cr
  22.                 SAY 'Deleteing previous CONFIG.NEW file'
  23.                 DEL 'config.new'
  24.         END
  25.  
  26.  
  27. IF drive = '?' THEN SIGNAL help
  28. IF drive = '' THEN SIGNAL help
  29.  
  30. Call SysFileSearch 'IFS=' , drive':\CONFIG.SYS', 'check.'
  31.         DO i=1 TO check.0
  32.                 CALL check_it
  33.         END
  34.  
  35. Call SysFileSearch 'BASEDEV=' , drive':\CONFIG.SYS', 'check.'
  36.         DO i=1 TO check.0
  37.                 CALL check_it
  38.         END
  39.  
  40. Call SysFileSearch 'SET' , drive':\CONFIG.SYS', 'check.'
  41.         DO i=1 TO check.0
  42.                 CALL check_it
  43.         END
  44.  
  45. Call SysFileSearch 'DEVICE=' , drive':\CONFIG.SYS', 'check.'
  46.         DO i=1 TO check.0
  47.                 CALL check_it
  48.         END
  49.  
  50. Call SysFileSearch '=' , drive':\CONFIG.SYS', 'others.'
  51.         DO i=1 TO others.0
  52.                 test = substr(others.i,1,3)
  53.                 PARSE UPPER VAR test test
  54.                 IF (test = 'SET') | (test = 'DEV') | (test = 'BAS') | (test = 'RUN') | (test = 'IFS') | (test = 'REM') THEN
  55.                         NOP
  56.                 ELSE
  57.             DO
  58.                             CALL CHAROUT 'config.new' , others.i
  59.                 CALL CHAROUT 'config.new' , cr
  60.                 CALL CHAROUT 'config.new',lf
  61.             END
  62.         END
  63.  
  64. Call SysFileSearch 'RUN=' , drive':\CONFIG.SYS', 'check.'
  65.         DO i=1 TO check.0
  66.                 CALL check_it
  67.         END
  68. SAY cr
  69. SAY cr
  70. SAY tab tab tab 'Your sorted 'drive':\CONFIG.SYS file has'
  71. SAY tab tab tab 'been saved as CONFIG.NEW.'
  72. SAY cr
  73.  
  74. exit
  75.  
  76. help:
  77.  
  78. SAY tab tab tab 'Usage:'
  79. SAY tab tab tab tab 'SORTBOOT d'
  80. SAY cr
  81. SAY tab tab tab 'Where:'
  82. SAY tab tab tab tab 'd is the drive letter that contains'
  83. SAY tab tab tab tab 'your CONFIG.SYS file.'
  84.  
  85. exit
  86.  
  87. check_it:
  88. test = substr(check.i,1,3)
  89. PARSE UPPER VAR test test
  90.         IF test = 'REM' THEN
  91.                 NOP
  92.         ELSE
  93.         DO
  94.             CALL CHAROUT 'config.new', check.i
  95.             CALL CHAROUT 'config.new',cr
  96.             CALL CHAROUT 'config.new',lf
  97.         END
  98. RETURN
  99.  
  100.