home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / netdor2.zip / DISK_10 / IMAGE9.ZIP / pmcal.cmd < prev    next >
OS/2 REXX Batch file  |  1993-06-30  |  2KB  |  73 lines

  1. /*****************************************************************************
  2.  *                              PMCal frontend                               *
  3.  *                     CORE Development (CORE at WATSON)                     *
  4.  *****************************************************************************
  5.  *                    Licensed Materials-Property of IBM                     *
  6.  *               5604-472 (c) Copyright IBM Corporation, 1993                *
  7.  *                           All rights reserved.                            *
  8.  *                  US Government Users Restricted Rights -                  *
  9.  *                 Use, duplication or disclosure restricted                 *
  10.  *                by GSA ADP Schedule Contract with IBM Corp.                *
  11.  ****************************************************************************/
  12. trace 'O'
  13. call setlocal
  14. say
  15. say ' PMCal initializing.  Please wait...'
  16. parse arg Args
  17. call rxfuncadd 'RXCOUINFO', 'COUENV', 'RXCOUINFO'
  18. CDr = RxCouInfo('GET', 'REMOTE')
  19. CDr = strip(CDr, 'T', '\')||'\'
  20. DDr = RxCouInfo('GET', 'DATA')
  21. DDr = strip(DDr, 'T', '\')||'\'
  22. PDr = value('PMCAL.DIR',,'OS2ENVIRONMENT')
  23. if PDr <> ''
  24.   then if \rxDirExist(PDr)
  25.     then PDr = ''
  26. if PDr = ''
  27.   then do
  28.     PDr = DDr
  29.     call value 'PMCAL.DIR', PDr, 'OS2ENVIRONMENT'
  30.   end
  31. call directory DDr
  32.  
  33. call 'MODPATH' 'PATH ADD' CDr'PMCAL FIRST /DUP /Q'
  34. call 'MODPATH' 'DPATH ADD' DDr 'FIRST /DUP /Q'
  35.  
  36. NoTz = wordpos('/NOTZ', translate(Args))
  37. if NoTz > 0
  38.   then do
  39.     call value 'TZ', '', 'OS2ENVIRONMENT'
  40.     Args = delword(Args, NoTz, 1)
  41.   end
  42.  
  43. Find = rxBootDrive()'\OS2\FIND.EXE'
  44. if rxFileExist(Find) = 0 then do
  45.    Ver = RxOS2Ver()
  46.    if Ver < 2.00 then Find = CDr'OS2BASE\1.3\FIND.EXE'
  47.    if Ver = 2.00 then Find = CDr'OS2BASE\2.0\FIND.EXE'
  48.    if Ver > 2.00 then Find = CDr'OS2BASE\2.1\FIND.EXE'
  49. end
  50.  
  51. PS   = rxBootDrive()'\OS2\PS.EXE'
  52. if rxFileExist(Find) & rxFileExist(PS)
  53.   then do
  54.     PreQ = queued()
  55.     PS '/C 2>NUL |' Find '"TIMEXEC" 2>NUL | RXQUEUE'
  56.     NowQ = queued()
  57.     RunTimeExec = (NowQ = PreQ)
  58.     do NowQ - PreQ; pull .; end
  59.   end
  60.   else RunTimeExec = 1
  61. say
  62. if RunTimeExec
  63.   then do
  64.     say ' Starting TIMEXEC...'
  65.     'DETACH' CDr'TIMEXEC > NUL 2>&1'
  66.   end
  67. say ' Starting PMLIST...'
  68. 'START' CDr'PMCAL\PMLIST -B -I -O'
  69. say ' Starting PMCAL...'
  70. CDr'PMCAL\PMCAL' Args
  71. call endlocal
  72. exit
  73.