How can I set the low and critical battery levels on my Windows Vista machine and control what my machine does when the battery reaches those levels?
By default, Vista will hibernate the machine when the remaining battery life reaches 5 percent, but you can modify that setting as needed. To do so, start the Power Options Control Panel applet and click the Change plan settings link under the power scheme (e.g., Performance, Balanced) currently in use. Then select Change advanced power settings. On the Advanced settings page, you'll see the various power elements available, as Figure 2 shows. The Battery settings let you specify the remaining battery life used to define critical and low battery levels in addition to the actions you want the system to perform upon reaching those levels. For example, if your battery power typically is consumed quickly, and hibernating when the remaining battery life reaches 5 percent doesn't allow for a full hibernation before battery power is completely drained, you can raise the critical level to 10 percent.

Under Windows XP, you can perform the same configurations via the Alarms tab of the Power Options Control Panel applet, which also lets you configure audio and visual cues for the alarm.