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