DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: [idea/request] Run program when laptop goes on/off battery  (Read 14,311 times)

fleon

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 8
[idea/request] Run program when laptop goes on/off battery
« on: September 01, 2008, 09:22 AM »
Does anyone know of a program (or a way in windows task scheduler) to run a program when a laptop goes on battery?  And then another program when it comes off battery?  For Vista, btw.

I really would like to be able to run my script that turns off Aero when my computer goes on battery- it's a significant power savings.

I know of a program called Vista Battery Saver which does something similar, but isn't acceptable.  It turns off Aero, which is more severe than turning off transparency.  Turning off Aero is overkill and doesn't seem to make much difference on battery life, so I really just want a way to turn off transparency.  It seems the most flexible way to do this would be to have a method for running programs when the computer detects that it has changed to battery and then when it goes back on AC. 

Thanks for any ideas/etc...

fleon

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 8
Re: [idea/request] Run program when laptop goes on/off battery
« Reply #1 on: September 01, 2008, 09:29 AM »
Never mind!  I have just discovered the most excellent tool "BatteryRun" by Skrommel.  Many thanks skrommel!  works great!

jgpaiva

  • Artificial Idiocy
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • Cody Award
    • Participated in NANY Challenge Once
    • Coding Snacks
    • Portugal Inhabitant
    • Linux User
Re: [idea/request] Run program when laptop goes on/off battery
« Reply #2 on: September 01, 2008, 10:23 AM »
:Thmbsup:
Just crosslinking with the batteryrun discussion thread: http://www.donationcoder.com/forum/index.php?topic=8631.0
And download it here ;)

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • Coding Snacks
    • Volunteers/Staff
    • Gathering Badge
    • Participated in NANY Challenge Once
    • Linux User
Re: [idea/request] Run program when laptop goes on/off battery
« Reply #3 on: September 01, 2008, 11:59 AM »
also this thread here will be useful with an usage example. :)

fleon

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 8
Re: [idea/request] Run program when laptop goes on/off battery
« Reply #4 on: September 04, 2008, 12:32 PM »
Thanks!  I have it running a batch file now to kick off a bunch of battery saving tricks :)

fcoury

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 2
Re: [idea/request] Run program when laptop goes on/off battery
« Reply #5 on: September 12, 2008, 07:50 PM »
Thanks!  I have it running a batch file now to kick off a bunch of battery saving tricks :)

Care to share?  :)

Catalin

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 18
Re: [idea/request] Run program when laptop goes on/off battery
« Reply #6 on: September 12, 2008, 08:34 PM »
There is also an open-source project called Windows Power Events Monitor at http://sourceforge.net/projects/windowspowereve/ ... also described at http://cool-stuff-or-not.blogspot.com/2008/02/managing-notebook-hdd-problems-with.html but you can just ignore the hdd-related part (which might work strange on certain configurations) and just use it to have your custom scripts executed on power events ... and of course you can extend the source code if you need that :)

Original address: https://www.donationcoder.com/forum/index.php?topic=14657.0