home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / recreate.zip / RECREATE.CMD
OS/2 REXX Batch file  |  1994-01-06  |  2KB  |  41 lines

  1. /* ReCreate.CMD - restore lost desktop objects              */
  2. /* by Greg Czaja - July 29, 1992                            */
  3. /*               - April 9, 1993  ver.2                     */
  4. /*                 handle 2.1-style INI.RC                  */
  5. /* the July 1992 REXXUTIL version is required for 2.0 GA    */
  6. /* (look for REXX20 in Lib 17 in OS2SUPPORT)                */
  7. /* no additional requirements for GA+SP or 2.1              */
  8. Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  9. Call SysLoadFuncs;
  10. SysBootDrive=Filespec('Drive',Value('SYSTEM_INI',,'OS2ENVIRONMENT'));
  11. file_name=SysBootDrive||'\OS2\INI.RC';
  12. Say "The program will list all single standard objects from your desktop"
  13. Say "Reply Y(es) if you want recreate the listed object - E(nd) to end the program"
  14. Say "N(o) is the default if you press ENTER:"
  15. Do While Lines(file_name) > 0;
  16. line=Linein(file_name);
  17. If line='' Then Iterate;        /* skip blanks   */
  18. Parse Var line '"PM_InstallObject"' line;
  19. If line='' Then Iterate;        /* skip others   */
  20. Parse Var line '"'head'" 'line; /* get header    */
  21. Parse Var line '"'setup'"' .;   /* get setup string */
  22. Parse Var head title';'object';'location';' . ;
  23. Say title "- Yes/No/End ?";
  24. Pull reply ;
  25. If Left(reply,1) ='E' Then Leave;
  26. If Left(reply,1) <> 'Y' Then Iterate;
  27. If SysCreateObject(object,title,location,setup,'Update') = 0
  28.    Then Say 'Error creating:' title;
  29.    Else Say title 'created !';
  30. End;
  31. rc=Stream(file_name,'C','Close');
  32. Return 0        /* enjoy your desktop! */
  33. /*
  34. Did you delete your Command Prompts ? Shredded your Shredder ?
  35. This program restores the standard WPS desktop objects on 2.x.
  36. It will preserve any current settings/objects you may have created and this
  37. is its advantage over the Alt-F1 or MAKEINI method.
  38. You will need the latest REXX fixes (REXX20 available in library 17) to make
  39. it run correctly on 2.0 GA system, no fixes required on GA+SP or 2.1.
  40. */
  41.