home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / repeat_.zip / Install.CMD next >
OS/2 REXX Batch file  |  1993-09-29  |  2KB  |  74 lines

  1. /* Install Program References for Repeat.CMD */
  2.  
  3. call RxFuncAdd 'SysCreateObject', 'RexxUtil', 'SysCreateObject'
  4.  
  5. parse arg arguments                         /* Fetch command line parms */
  6. arguments  = STRIP(arguments)
  7. parse upper var arguments arguments_upcase  /* convert to upper case */
  8.  
  9. if (arguments='' | arguments='?' | arguments='/?') then
  10.    do
  11.      call Help
  12.      exit 0
  13.    end
  14.  
  15. curdir = directory()
  16. newdir = directory(arguments_upcase)
  17. parse upper var curdir curdir_upcase
  18. parse upper var newdir newdir_upcase
  19.  
  20. if newdir_upcase = arguments_upcase then
  21.   do
  22.     say 'Found directory ''' || arguments || ''''
  23.     newdir = directory(curdir)
  24.   end
  25. else
  26.   do
  27.     say 'Can''t find directory ''' || arguments || ''''
  28.     call Help
  29.     exit 0
  30.   end
  31.  
  32. if newdir_upcase <> curdir_upcase then do
  33.    copy Repeat.CMD arguments
  34. end
  35.  
  36. If SysCreateObject("WPProgram",,
  37.                    "Drag and drop a multimedia file here" || '0d'x || '0a'x ||,
  38.                    "to play it continuously",,
  39.                    "<WP_DESKTOP>",,
  40.                    "EXENAME=PMREXX.EXE;PARAMETERS=" || arguments || "\Repeat.cmd file='%*'")  Then
  41.    Say 'Program 1 has been created'
  42.  
  43. If SysCreateObject("WPProgram",,
  44.                    "Drag and drop a multimedia file here" || '0d'x || '0a'x ||,
  45.                    "to play it n times",,
  46.                    "<WP_DESKTOP>",,
  47.                    "EXENAME=PMREXX.EXE;PARAMETERS=" || arguments || "\Repeat.cmd file='%*' count=[How many times?]")  Then
  48.    Say 'Program 2 has been created'
  49.  
  50. /*
  51. ** Exit, return code = 0.
  52. */
  53. exit 0
  54.  
  55.  
  56. /*  -- help --
  57. ** Display help text
  58. */
  59. Help:
  60.    say
  61.    say 'This command copies Repeat.CMD to your MMOS2 directory'
  62.    say 'and installs two Program References for it on your desktop.'
  63.    say
  64.    say 'Usage:'
  65.    say
  66.    say '        Install d:\dir'
  67.    say
  68.    say 'where'
  69.    say '        d:\dir       Drive and directory in which MMOS2'
  70.    say '                     is installed; e.g. C:\MMOS2'
  71. return
  72.  
  73.  
  74.