home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sfx.zip / Rebuild.cmd < prev    next >
OS/2 REXX Batch file  |  2000-01-13  |  1KB  |  46 lines

  1. /********************************************/
  2. /* Run this script to set up                */
  3. /* a new desktop object                     */
  4. /********************************************/
  5.  
  6. /* Prerequisites for the desktop object     */
  7. /* and this cmd file                        */
  8. crlf    ='0d0a'x
  9. exe    ='sfxsetup.exe'
  10. Title    ='SFX Setup'
  11. Setup    ='OBJECTID=<SFX>;'||,
  12.      'EXENAME=' || Directory() || '\' || exe || ';' ||,
  13.      'STARTUPDIR=' || Directory() || ';' ||,
  14.      'PROGTYPE=PM;'
  15.  
  16. /* Load RexxUtil DLL                        */
  17. call RxFuncAdd 'SysLoadFuncs' , RexxUtil, 'SysLoadFuncs'
  18. call SysLoadFuncs
  19. Call SysCls
  20.  
  21. say crlf crlf
  22. say 'This script sets up the desktop object for '||Title
  23. say 'Be sure you are running this from the '||Title||' directory.'||crlf crlf
  24.  
  25. say 'Press [Y] to continue or [Enter] to quit'||crlf
  26. pull approval
  27. if approval <> 'Y' then exit
  28. say ''
  29.  
  30. /* Are we in the right program directory?   */
  31. say 'Locating '||exe||'...'||crlf
  32. TestFor=directory()||'\'||exe
  33. CALL SysFileTree TestFor,'List','FO'
  34. if List.0 = 0 then do
  35.    say 'Please run this program from the same directory as the '||exe||' file'||crlf
  36.    say 'Exiting...'||crlf
  37.    exit
  38. end
  39.  
  40. call SysCreateObject "WPProgram", Title, "<WP_DESKTOP>", Setup, 'Update'
  41. /* Check if the WPS object was created      */
  42. if rc = 0 then
  43.    say 'Object creation for 'Title ' failed!  rc='||crlf
  44. else
  45.    say 'Object created for' Title||crlf
  46.