home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / sticky2.zip / makewps.cmd < prev    next >
OS/2 REXX Batch file  |  1995-06-22  |  4KB  |  94 lines

  1. /* ------------------------------------------------------------------------ */
  2. /* Create The STICKY/2 Desktop                                              */
  3. /* ------------------------------------+----------------------------------- */
  4. /* History:                                                                 */
  5. /* --------                                                                 */
  6. /*                                                                          */
  7. /* created: Jun 22 1995 by AJW -                                            */
  8. /* ------------------------------------------------------------------------ */
  9. Version = 'MAKEWPS Version 1.00 June 22, 1995'
  10.  
  11. /* --- make sure RXUTILS are loaded --------------------------------------- */
  12. ADDRESS CMD '@echo off'
  13. CALL RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  14. CALL SysLoadFuncs
  15.  
  16. /* --- now here starts the real program ----------------------------------- */
  17. PARSE ARG argstring
  18. argstring = TRANSLATE(STRIP(argstring))
  19. IF substr(argstring,1,1)='?' THEN DO
  20.   SAY "+--------------------------------------------------------------------+"
  21.   SAY "| MAKEWPS.CMD Version 1.00                                           |"
  22.   SAY "| ------------------------                                           |"
  23.   SAY "|                                                                    |"
  24.   SAY "| Creates a STICKY/2 Object on the desktop                           |"
  25.   SAY "|                                                                    |"
  26.   SAY "|   You *MUST* be in the directory where STICKY2.EXE is when         |"
  27.   SAY "|   this command file is run.                                        |"
  28.   SAY "|                                                                    |"
  29.   SAY "| SYNTAX:                                                            |"
  30.   SAY "| MAKEWPS [?]                                                        |"
  31.   SAY "|                                                                    |"
  32.   SAY "| where:                                                             |"
  33.   SAY "|                                                                    |"
  34.   SAY "+--------------------------------------------------------------------+"
  35.   EXIT 99
  36. END
  37.  
  38. /* --- get the component name --------------------------------------------- */
  39.  
  40. MsgON   = 1
  41. Sleep   = 1
  42. Target  = 'ALL'
  43. NewLine = X2C('0D0A')
  44. Success = 1
  45.  
  46. /* --- set up the component list ------------------------------------------ */
  47. curDir       = DIRECTORY()
  48. FolderID     = '<WP_DESKTOP>'
  49.  
  50. i = 0
  51. DO
  52.   i               = i+1
  53.   Obj.0           = i
  54.   Obj.i.Class     = 'WPProgram'
  55.   Obj.i.Check     = ''
  56.   Obj.i.Title     = "Sticky/2"
  57.   Obj.i.Setup     = 'OBJECTID=<STICKY2>;EXENAME=' || curDir || '\STICKY2.EXE'
  58.   Obj.i.ParentID  = '<WP_DESKTOP>'  /* '<WP_DESKTOP>' */
  59. END
  60.  
  61. /* --- register and create WPS objects --------------------------- */
  62.   IF MsgOn THEN DO
  63.     SAY '*******************************************************************************'
  64.     SAY '*******************************************************************************'
  65.     SAY '*****                                                                     *****'
  66.     SAY '*****  Creating the Sticky/2 Desktop Object                               *****'
  67.     SAY '*****                                                                     *****'
  68.     SAY '*******************************************************************************'
  69.     SAY '*******************************************************************************'
  70.   END
  71.   DO i = 1 TO Obj.0
  72.     rc = 1
  73.     IF Obj.i.Check <> '' THEN DO
  74.       /* check if the prerequisite file for this object exists */
  75.       CALL SysFileTree Obj.i.Check, 'file', 'FO'
  76.       IF file.0 = 0 THEN ITERATE
  77.     END
  78.     DO
  79.       /* create object */
  80.       rc = SysCreateObject(Obj.i.Class, Obj.i.Title, Obj.i.ParentID, Obj.i.Setup, 'ReplaceIfExists');
  81.       IF rc <> 1 THEN DO
  82.         n = SysSleep(Sleep)
  83.         /* retry */
  84.         rc = SysCreateObject(Obj.i.Class, Obj.i.Title, Obj.i.ParentID, Obj.i.Setup, 'ReplaceIfExists');
  85.       END; ELSE DO
  86.         IF MsgON THEN DO
  87.           SAY 'Created object:' Obj.i.Title
  88.         END
  89.       END
  90.     END
  91.   END
  92.  
  93. EXIT
  94.