Most of us treat our Windows laptop batteries like a fuel tank: fill it to 100%, run it to 0%, and repeat. However, Lithium-ion batteries actually prefer to stay in the "Sweet Spot" between 40% and 80%. Charging that last 20% (from 80% to 100%) causes high voltage stress and heat, which degrades the battery cells faster. Conversely, letting it drop below 40% regularly can lead to deep-discharge wear.
If you want your hardware to last for years instead of months, it's time to automate your alerts. Here is how to set up a custom "Full Charge" alarm at 80% using a simple Windows script.
Step 1: Create the Battery Alert Script:
We will use a tiny bit of code called a VBScript. This will trigger a popup message and a voice alert when your battery reaches 80%.
1. Open Notepad.
2. Copy and paste the following code below:
set oLocator = CreateObject("WbemScripting.SWbemLocator")
set oServices = oLocator.ConnectServer(".","root\wmi")
set oResults = oServices.ExecQuery("select * from BatteryStatus")
for each oResult in oResults
iPercent = oResult.RemainingCapacity
next
if iPercent >= 80 then
msgbox "Battery is at " & iPercent & "%. Please unplug your charger to maintain battery health.", 48, "Battery Health Alert"
Set Sapi = Wscript.CreateObject("SAPI.SpVoice")
Sapi.speak "Battery reached 80 percent. Please unplug."
end if
3. Click File > Save As.
4. Name the file BatteryCheck.vbs (ensure it ends in .vbs, not .txt).
5. Save it to a permanent folder, like C:\Scripts\.
Step 2: Automate it with Task Scheduler:
You don't want to run this file manually; you want Windows to check the battery for you every few minutes.
1. Press the Windows Key, type Task Scheduler, and hit Enter.
2. In the right-hand "Actions" pane, click Create Basic Task.
3. Name: Call it "Battery 80 Percent Alert."
4. Trigger: Select When I log on. (This ensures the check starts as soon as you use your PC).
5. Action: Select Start a Program.
6. Program/script: Click Browse and select the BatteryCheck.vbs file you saved earlier.
7. Finish: Click Finish to create the task.
Making it Repeat Every 15 Minutes:
To make sure it checks the battery continuously while you work:
1. Find your task in the Task Scheduler Library.
2. Right-click it and select Properties.
3. Go to the Triggers tab, select the trigger, and click Edit.
4. Check the box for Repeat task every: and set it to 15 minutes (or 5 minutes if you prefer).
5. Set the duration to Indefinitely.
6. Click OK.
The Result:
Now, every 15 minutes, Windows will silently check your battery level. The moment it hits 80% or higher, a window will pop up, and a voice will remind you to unplug.
If this 80/40 tip helps you get more years out of your laptop and keeps your hardware running at peak performance, please consider supporting the blog. Your support allows us to keep sharing these deep-dive technical guides!
Be awesome: Buy us a Coffee!
By visiting our ❤️ page.Stay Connected to The Somebody, Nobody, Anybody & Everybody Blog!:
On X: Want the latest updates and insights in real-time? Follow Mister Kayne on X to stay connected and never miss a post. May the FORCE be with You!
By Mail: Want the latest delivered straight to your inbox? Just enter your email ID in the subscribe by mail form and hit Submit.
Note: Be sure to check your Inbox or Junk folder right away for the confirmation email—you won't be officially subscribed until you click that link!
Comments
Post a Comment