ghacks Technology News

Run something if battery is (dis)connected


It sometimes happens by accident that the power cable gets disconnected when you work with your notebook. It does not have to be by accident though, maybe you want to use the notebook in a different location without having to save everything and boot again. The problem that arises when a power cable gets disconnected is that the notebook loses battery power which is a huge problem if the battery was not loaded fully.

Battery Run is a little command line utility that checks if a power cable is connected. Once it gets disconnected it starts a user defined action and another one when the cable gets connected again. You could for instance play a sound if the power cable gets disconnected to notify you or a software that would reduce power consumption.

Usage is straightforward. Download and unpack the file on your hard drive. Use the command batteryrun load-program-when-disconnected load-program-when connected. For example: batteryrun disconnected.wav connected.wav

Batteryrun will play the disconnected.wav file when the power cable gets disconnected and the connected.wav file when it gets connected again. A icon should appear in the system tray if everything was setup correctly.




Tags: , , , , ,
Categories: Mobile Computing, Notebooks, Operating Systems, Windows, software



Related posts:

Test your notebooks battery
Vista Battery Saver Beta
Display Notebook Battery Status
Extend Windows Vista Battery Live for Notebooks
Windows Vista Notebook Battery Saver
Laptop Battery Monitor BattCursor
Notebook Battery Monitor
Notebook Hardware Control

3 Responses to “Run something if battery is (dis)connected”

  1. yair says:

    just what i needed, thanks!

  2. duryodhan says:

    All of the notebooks I have used, you can see a noticeable difference in screen brightness as soon as the ac power is connected and a sound is also played. A light on the laptop also turns off.

  3. yair says:

    i use an old laptop to run a 3 year unattended time-lapse photography. it is connected to UPS.
    if i have severe power failure i need to run a notification when the ups fails and the battery kicks in.
    i use gcal command line utility to send an sms.
    anyways this is exactly what indeed…

Leave a Reply   Follow Ghacks   Subscribe To Comment Rss

© 2005-2009 Ghacks.net. All Rights Reserved. Privacy Policy - About Us