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

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