home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / odrtime.zip / OPENPACK / EPM / WPSCRED.CMD < prev   
OS/2 REXX Batch file  |  1995-11-16  |  2KB  |  67 lines

  1. /* Install Object REXX in the Shell process. */
  2.  
  3. /* trace ?R */
  4.  
  5. call RxFuncAdd 'SysLoadFuncs', 'rexxutil', 'SysLoadFuncs'
  6. call SysLoadFuncs
  7. '@echo off'
  8.  
  9. if SysOS2Ver() < '2.30' then Do
  10.   Say "OS/2 Warp is required for Workplace Shell support"
  11.   Exit 3
  12. End
  13.  
  14.  /* find the directory with icons etc... */
  15. parse source . . myname .;
  16.   n = lastpos('\',myname)
  17.  
  18.   if n = 0 then do
  19.       say 'cannot find the base directory ...'
  20.       exit 27
  21.     end
  22.  
  23.   dir = left(myname,n-1)
  24.  
  25. parse upper arg 'EXEDIR' '=' bindir .
  26.  
  27. if bindir = "" then do
  28.   n = lastpos('\',dir)
  29.  
  30.   if n = 0 then do
  31.       say 'cannot find the EXE directory ...'
  32.       exit 23
  33.     end
  34.  
  35.   bindir = left(dir,n)
  36. end
  37.  
  38. if right(bindir,1) <> '\' then  bindir = bindir||'\'
  39. dir = dir || '\'
  40.  
  41. call SysFileTree bindir||'scredrec.exe', 'fls', "FO"    /* find the fully specified dir name ... */
  42. if fls.0=0 then do
  43.   say 'scredrec.exe not found'
  44.   exit 46
  45. end
  46.  
  47. bindir=left(fls.1,length(fls.1)-length("scredrec.exe"))
  48.  
  49. /* if SysRegisterObjectClass('SCREDREC',bindir||'SCREDREC.DLL') = 0 then do
  50.     say 'SCREDREC registration failed.'
  51.     exit 56
  52.   end */
  53.  
  54.   params=''
  55.   params=params||'ICONFILE='||dir||'scredrec.ico;'
  56.   params=params||'EXENAME='||bindir||'scredrec.exe;'
  57.   params=params||'PROGTYPE=PM;'
  58.   params=params||'STARTUPDIR='||bindir||';'
  59.   params=params||'PARAMETERS=;'
  60.   params=params||'ASSOCTYPE=OSA Script source,OSA compiled Script,,;'
  61.   params=params||'OBJECTID=<SCREDREC>'
  62.  
  63.   Call SysCreateObject 'WPProgram','Script Editor','<WP_DESKTOP>',params,'R'
  64.  
  65. exit
  66.  
  67.