How to Create a Notification That Your Laptop Battery Is Charged on Windows 10 & 11
By Timothy Tibbetts |
While there are a few laptop battery notifications available, one missing is a notification that the battery is charged. Here's a neat trick to get notified when your battery is charged.
Open Notepad, then copy and paste the following into Notepad:
set oLocator = CreateObject("WbemScripting.SWbemLocator")
set oServices = oLocator.ConnectServer(".","rootwmi")
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
wend
Click on File, Save As. Under Save as type, click the drop-down and choose All Files (*.*). Name it anything you like but be sure the name ends with .vbs. (we used Battery Full.vbs).
Right click on the new VBS file and select Copy. Open File Explorer and enter C:\ProgramData\Microsoft\Windows\Start Menu\Programs in the search bar. Right-click inside the StartUp folder and select Paste.
Reboot for the script to start working.
Tips and tricks:
Uninstall: Open a Command Prompt and type in taskkill /im wscript.exe /f. Now delete the VBS file from Startup. Reboot.
Change Percentage: If you want a different percentage, look at the third line from the bottom and find (iPercent > 95) and change the 95 to whatever percentage you want a notification. While we're here, the 3000 and 5 minutes is how often the script will check your battery.
Change Percentage Two However, some say simply changing the 95 does not work. If it does not work for you, change the third line to read:
if bCharging and (iPercent > 40) and (flg>0) Then msgbox "Battery is at " & iPercent & "%",vbInformation, "Battery monitor"
Then add these two lines below that.
if (flg>0) and (iPercent>40) Then flg=0
if (flg
Open Notepad, then copy and paste the following into Notepad:
set oLocator = CreateObject("WbemScripting.SWbemLocator")
set oServices = oLocator.ConnectServer(".","rootwmi")
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
wend
Click on File, Save As. Under Save as type, click the drop-down and choose All Files (*.*). Name it anything you like but be sure the name ends with .vbs. (we used Battery Full.vbs).
Right click on the new VBS file and select Copy. Open File Explorer and enter C:\ProgramData\Microsoft\Windows\Start Menu\Programs in the search bar. Right-click inside the StartUp folder and select Paste.
Reboot for the script to start working.
Tips and tricks:
Uninstall: Open a Command Prompt and type in taskkill /im wscript.exe /f. Now delete the VBS file from Startup. Reboot.
Change Percentage: If you want a different percentage, look at the third line from the bottom and find (iPercent > 95) and change the 95 to whatever percentage you want a notification. While we're here, the 3000 and 5 minutes is how often the script will check your battery.
Change Percentage Two However, some say simply changing the 95 does not work. If it does not work for you, change the third line to read:
if bCharging and (iPercent > 40) and (flg>0) Then msgbox "Battery is at " & iPercent & "%",vbInformation, "Battery monitor"
Then add these two lines below that.
if (flg>0) and (iPercent>40) Then flg=0
if (flg