home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / mousechg.zip / MOUSECHG.CMD < prev    next >
OS/2 REXX Batch file  |  1993-08-15  |  2KB  |  90 lines

  1. /* MOUSECHG.CMD -- utility to change the mouse pointer for OS/2 2.1
  2.  
  3. Steve Allen
  4. Altech Computer Services
  5. 121 Herta St.
  6. Easley, SC 29640
  7.  
  8. Aug 93
  9. */
  10.  
  11. call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  12. call sysloadfuncs
  13.  
  14. say ""
  15. say "MOUSECHG v1.3 1993"
  16. say "Altech Computer Services" 'fe'x "Steve Allen"
  17. say ""
  18.  
  19. arg mouseptr
  20.  
  21. if mouseptr = "" then 
  22.     do
  23.         call beep_error
  24.         say "Usage is MOUSECHG mouse_pointer_name (give full path name)"
  25.         say "Example: MOUSECHG c:\mouse.ptr"
  26.         exit(1)
  27.     end
  28.  
  29. ptr = stream(mouseptr, 'c', 'query exists')
  30.  
  31. if ptr = "" then 
  32.     do
  33.         call beep_error
  34.         say "Please check to make sure" mouseptr "is valid filename."
  35.         say "Make sure you have the COMPLETE pathname, including the "
  36.         say "correct drive name."
  37.         exit(2)
  38.     end
  39.  
  40. ver = SysOS2Ver()
  41. if ver = "2.10" then 
  42.     do
  43.         say "Backing up \OS2\OS2.INI to OS2.BAK"
  44.         "COPY \OS2\OS2.INI OS2.BAK"
  45.         backup = stream("\OS2\OS2.BAK", 'c', 'query exists')
  46.         if backup = "" then
  47.             do
  48.                 call beep_err
  49.                 say "Error creating backup file OS2.BAK from \OS2\OS2.INI."
  50.                 say "For safety's sake, this file must exist before"
  51.                 say "you may run MOUSECHG again.  You may wish to back up"
  52.                 say "this file manually."
  53.                 exit(3)
  54.             end
  55.     end
  56. else
  57.     do
  58.         call beep_error
  59.         say "MOUSECHG runs ONLY under OS/2 2.1.   Your version is OS/2" ver
  60.         say "MOUSECHG aborted."
  61.         exit(4)
  62.     end
  63.  
  64.  
  65. say "Creating custom mouse pointer in OS2.INI file..."
  66. key = x2c('01 00 00 00')||mouseptr||x2c('00');
  67.  
  68. result = sysini('user', 'PM_SysPointer', '1', key)
  69.  
  70. if result = "" then
  71.     say "New mouse pointer installed successfully.  Now reboot."
  72. else
  73.     do
  74.         call beep_error
  75.         say "Error creating new mouse pointer."
  76.         exit(5)
  77.     end
  78.  
  79. return
  80.  
  81.  
  82. beep_error:
  83.     duration = 100
  84.     call beep 262, duration
  85.     call beep 330, duration
  86.     call beep 262, duration
  87. return
  88.  
  89. /* end of MOUSECHG.CMD */
  90.