How to stop killing your battery by overcharging your laptop [Tip]

You must have wondered one day or the other as to why your laptop battery has been draining faster than before. Say, when the battery was new, you used to get 5 hours of juice without charging the battery again, but after one year, it is giving you only 2 hours to run your laptop before plugging it into a power outlet.

Well, any battery in the world can be charged for a finite number of cycles. Moreover, the battery degrades over the time. And, the bad news is this degradation gets exacerbated by overcharging. True that it is best to fully charge, then fully discharge; however, if you want to retain the battery life better, you need to stop overcharging.Some power adapters automatically shut off charging when the battery is full. I rarely see it though as the vendors want you to kill the battery (as early as possible) for the obvious business reason. The software from some OEM (Original Equipment Manufacturer) may have a configuration utility to implement or have an on-screen display like ‘Do not charge if the battery level is above X %’.

The Windows system, by default, offers a Low battery notification (and, helps the laptop Sleep, Hibernate or Shut down before the battery is completely exhausted), but not a ‘high battery alert’ until the battery is fully charged. Therefore, one option is that you have to keep a close eye on how much the battery is charged. This is not quite practical given our busy life. The obvious jeopardy is that you just forget about it, and mostly end up overcharging the battery. You actually want to receive a notification about how much charge your battery has, or how full it is. Auspiciously, both challenges may be overcome by using a simple script. You can use this method to get an audiovisual alert for when your battery is charged up to a definite level (you can set a limit to the minimum or maximum charge). You could have used a free app like Battery Limiter, but if you don’t like installing yet another app, this script comes to the rescue.

Copy & paste the script (given below; credit goes to the original coder) onto the “Notepad” window, and Save As battery.vbs (change .txt to .vbs). Save this file to the folder of your choice, and create a ‘shortcut’ for it. Paste the shortcut in your Startup folder (Start > All Programs > Startup & then, right-click to Open) as you need it to run automatically. If you don’t like it to run every time you boot your system, place the file (and its shortcut) out of the Startup folder, and run it when you want to.

Understandably, it won’t work perfectly if you have multiple batteries.

set oLocator = CreateObject("WbemScripting.SWbemLocator")

set oServices = oLocator.ConnectServer(".","root\wmi")

set oResults = oServices.ExecQuery("select * from batteryfullchargedcapacity")

for each oResult in oResults

iFull = oResult.FullChargedCapacity

next

 

while (1)

set oResults = oServices.ExecQuery("select * from batterystatus")

for each oResult in oResults

iRemaining = oResult.RemainingCapacity

bCharging = oResult.Charging

next

iPercent = ((iRemaining / iFull) * 100) mod 100

if bCharging and (iPercent > 95) Then msgbox "Battery is at " & iPercent & "%",vbInformation, "Battery monitor"

wscript.sleep 30000 ' 5 minutes

wendBattery monitor

This script notifies you using a popup dialog box (see the screenshot above) when the battery reaches 96% (with sound, if you don’t mute your system). You can edit the line if bCharging and (iPercent > 95) Then msgbox “Battery is at ” & iPercent & “%”,vbInformation, “Battery monitor”, and substitute the value in (iPercent > 95) to whatever value fits your liking. The popup comes back to remind you if you close the dialog box without unplugging. As the battery gets more and more charged, the popup reflects it (i.e., ‘Battery is at 97%’, ‘Battery is at 98%’, and so on).

I have tested this script in Windows 7 Professional 64-bit.

Does it work for you? Are you ready to protect your notebook battery from being dead sooner than expected? Let us know in the comments!

Related Posts