home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: OtherApp / OtherApp.zip / upsmon2.zip / upsmons.cmd < prev    next >
OS/2 REXX Batch file  |  1999-07-19  |  3KB  |  83 lines

  1. /* UPSMONS.CMD - External shutdown script for UPS Monitor for OS/2 */
  2.  
  3. /* CAUTION: As shipped, this file will not do anything. You must first
  4.             select and unremark one of the listed shutdown scripts.
  5.             Please read the comments carefully. Some of these samples
  6.             will not shutdown OS/2 without prompts.
  7.  
  8.    DO NOT use SETBOOT because SETBOOT will restart your system after a shutdown.
  9.    UPS may be armed for a timed turn-off and kill the power as you computer reboots.
  10.    See the UPS Monitor Help for more details on disabling of the UPS turn-off.
  11.  
  12.    RECOMMENDATION: Use external shutdown only if you are 110% sure what you are doing.
  13. */
  14.  
  15.  
  16. /* The SIMPLEST way
  17.    If you only run PM applications, 'start SHUTDOWN' will work.
  18.    Problem: Any DOS or OS/2 windowed or full screen sessions
  19.    including Win-OS2 sessions, this will NOT work
  20.    as you will be prompted to close these sessions. */
  21. /*
  22. 'start SHUTDOWN'
  23. */
  24.  
  25. /* Warp 4 FP6 and later only.
  26. You can use TSHUTDWN which is supplied on the last fixpack disk. You have to
  27. unpack it manually, it is NOT installed automatically when you apply the fixpack.
  28. TSHUTDWN is said to shutdown without prompting, however in some cases it will not work.
  29. I could not shutdown an OS/2 full-screen sessions without getting prompted for it.
  30. According to the fixpack README.1ST file, using TSHUTDWN /N will shutdown without prompting,
  31. but again it did not work for me. Try TSHUTDWN first before you use it in this script.
  32. */
  33.  
  34. /*
  35. 'start TSHUTDWN'
  36. */
  37.  
  38.  
  39. /* The UPSPMSD.DLL way
  40. These commands below issue a DOSShutdown API call and secures the file system
  41. such that the computer is ready to be turned off. It leaves the Presentation
  42. Manager displayed but no user input is possible. Because the UPS is armed to turn
  43. itself off, DO NOT reboot your computer. Rather, turn the UPS off, then on again.
  44. That will reset the internal UPS turn-off timer.
  45.  
  46. DOSShutdown will secure the file system even if an irate thread is tying up your
  47. system and would prevent a regular shutdown.
  48.  
  49. This is the command that gets executed when the external shutdown is disabled.
  50. */
  51.  
  52.  
  53. /*
  54.  
  55. /* Load the UPSPMSD.DLL (supplied with UPS Monitor) */
  56. call RxFuncAdd 'UPSLoadFuncs', 'UPSPMSD', 'UPSLoadFuncs'
  57. call UPSLoadFuncs
  58.  
  59. SAY 'UPS Monitor is shutting system down. Please wait...'
  60. rc = DosShutd('0')  /* perform the shutdown */
  61.  
  62. IF rc = 0 THEN
  63.   DO
  64.     SAY 'Shutdown has completed. The UPS has been armed and will'
  65.     SAY 'turn off your computer after the set turn-off delay.'
  66.     SAY 'Do NOT use Ctrl-Alt-Del to restart.'
  67.     SAY 'To restart the system now, turn the UPS off'
  68.     SAY 'manually and then restart.'
  69.   END
  70. ELSE
  71.   SAY 'DosShutdown failed, rc = ' || rc
  72.  
  73. */
  74.  
  75. SAY 'UPSMONS.CMD - External shutdown script for UPS Monitor for OS/2'
  76. SAY ''
  77. SAY 'CAUTION: As shipped, this file will not do anything.'
  78. SAY 'You must first select and unremark one of the listed'
  79. SAY 'shutdown scripts inside this file'.
  80.  
  81. EXIT
  82.  
  83.