Saturday, October 30, 2010

Optimising Battery


Whilst preparing my media for a long haul flight I have coming up recently, I wanted to make sure I got every last drop of energy out of my laptop battery before it ran out.

What I wanted to do was have a script which closed all applications which are not required to run. All I want is to be able to watch VLC, but I have a number of programs which are running in the background on startup e.g. Dropbox. Obviously this is no use to me on a plane so why leave it running and have it wasting CPU resource?

I first of all found this useful article at Lifehacker for quitting all applications

The second thing I wanted this script to do was to change the power management profile to my super battery saving mode. Windows 7 gives you loads of options to tweak this how you see fit.

I used the powercfg command to set the profile. More details on this can be found here

Lastly I wanted to pin this in the taskbar. In Windows 7 you cannot pin batch files to the taskbar. There are lots of ways around this, I used the following

So my script is as follows (replace username with actual username and GUID of power management profile which is relevant to you)

#battery optimiser
powercfg -s df011ed9-9131-49b9-8090-46963cfb65ce
C:\Windows\System32\taskkill.exe /F /FI "USERNAME eq username" /FI "IMAGENAME ne explorer.exe" /FI "IMAGENAME ne dwm.exe"

The shortcut I created just had explorer.exe preceed it to make sure it could pin to the taskbar

C:\Windows\explorer.exe "C:\Users\username\My Dropbox\Personal\Battery Optimiser.bat"

Some really useful information here and you can tweak it quite a lot to suit you.




Post a Comment