home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vpceva.zip / REBLDC.CMD < prev    next >
OS/2 REXX Batch file  |  1994-09-15  |  2KB  |  67 lines

  1. /*  This file rebuilds your VisPro/C desktop
  2.  *  you would execute this file if your system
  3.  *  INI files become damaged, or if you accidentally
  4.  *  delete the VisPro/C WorkPlace Shell icon.
  5.  *
  6.  *  This program assumes you have already installed
  7.  *  VisPro/C and have the product in the PATH
  8.  *  variable of your CONFIG.SYS.
  9.  */
  10. call rxfuncadd 'sysloadfuncs','rexxutil','sysloadfuncs'
  11. call sysloadfuncs
  12. PRODCHECK=syssearchpath('PATH','VISPROC.EXE')
  13. PRODUCTDIR=left(PRODCHECK,length(PRODCHECK)-12)
  14. PROJECTDIR=PRODUCTDIR'\projects'
  15. SAMPLESDIR=PRODUCTDIR'\samples'
  16. INFILE='VISPRO'
  17. rc=stream(INFILE,'c','open')
  18. if rc<>'READY:' then do
  19.    say ''
  20.    say '  Error opening the VISPRO control file.'
  21.    say '  Run this program from the VisPro/C'
  22.    say '  installation disk 1.'
  23.    say ''
  24.    exit
  25. end
  26. if lines(INFILE)<1 then do
  27.    say ''
  28.    say '  Error opening the VISPRO control file.'
  29.    say '  Run this program from the VisPro/C'
  30.    say '  installation disk 1.'
  31.    say ''
  32.    rc=stream(INFILE,'c','close')
  33.    call sysfiledelete(VISPRO)
  34.    call sysdropfuncs
  35.    exit
  36. end
  37. say 'Recreating objects...'
  38. do 9
  39.    null=linein(INFILE)
  40. end /* do */
  41.  
  42. INSTRING=linein(INFILE)
  43.  
  44. do while left(INSTRING,1)='('
  45.    COMMAND='rc=syscreateobject'||INSTRING
  46.    interpret COMMAND
  47.    if rc<>1 then do
  48.       say '  ERROR'
  49.       say '  An error occured while processing the string'
  50.       say ' 'COMMAND
  51.       say '  Check to make sure the affected files/directories'
  52.       say '  exist, then run this program again.'
  53.       say '  Check the online REXX reference for more information'
  54.       say '  on the SysCreateObject call.'
  55.       rc=stream(INFILE,'c','close')
  56.       call sysfiledelete(VISPRO)
  57.       call sysdropfuncs
  58.       call sysdropfuncs
  59.       exit
  60.       end
  61.    INSTRING=linein(INFILE)
  62. end /* do */
  63.  
  64. rc=stream(INFILE,'c','close')
  65. call sysdropfuncs
  66. say 'Objects successfully recreated.'
  67.