home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Backup / Backup.zip / bacrest.zip / invtapec.cmd < prev    next >
OS/2 REXX Batch file  |  1999-10-05  |  2KB  |  61 lines

  1. /* -------------------------------------------------- */
  2. /* Title:               Invtapec.cmd                  */
  3. /*                                                    */
  4. /* Author:              J.Cobb                        */
  5. /*                                                    */
  6. /* Change History:      13/1/1998 - Created JAC       */
  7. /*                                                    */
  8. /* Function:            Looks throuh the config.sys   */
  9. /*                      file and removes tape support */
  10. /* -------------------------------------------------- */
  11.  
  12.  
  13. Parse Upper Arg bootdrv target_path
  14.  
  15. _prodsdid = 'ADSMSDID.SYS'     /* SCSI tape auto detect driver */
  16. _prodtape = 'ADSMTAPE.SYS'     /* SCSI tape interface */
  17.  
  18.  
  19. /* Query the system functions */
  20. if RxFuncQuery(SysTempFileName) <> 0 then
  21.    if RxFuncAdd(SysTempFileName,Rexxutil,SysTempFileName) <> 0 then Exit
  22.  
  23. if RxFuncQuery(SysFileDelete) <> 0 then
  24.    if RxFuncAdd(SysFileDelete,Rexxutil,SysFileDelete) <> 0 then Exit
  25.  
  26. Call Modify_Config
  27.  
  28. Exit
  29.  
  30. Modify_Config:Procedure expose bootdrv _prodsdid _prodtape target_path
  31.  
  32.    in_file = bootdrv'\config.sys'
  33.  
  34.    temp_file = systempfilename(bootdrv'\pssconf.???')
  35.  
  36.    do i=1 by 1 while lines(in_file) > 0
  37.       raw_line = linein(in_file)
  38.       traw_line = translate(strip(raw_line))
  39.       Select  
  40.          when (traw_line = 'DEVICE='target_path || '\' || _prodtape),
  41.               | (traw_line = 'DEVICE='target_path || '\' || _prodsdid),
  42.               then NOP
  43.          otherwise call lineout temp_file, raw_line
  44.       end  /* select */
  45.    end
  46.  
  47.    call lineout in_file /* Close file */
  48.  
  49.  
  50.    /* Close our temporary copy of CONFIG.SYS. */
  51.    call lineout temp_file
  52.  
  53.    /* Copy temp_file to give new config.sys. */
  54.    action = 'COPY' temp_file in_file
  55.    action
  56.  
  57.    call sysfiledelete temp_file
  58.  
  59. return
  60.  
  61.