- Dec 26, 2013
- 562
Please note, I have changed 30000 to 300000 in the above script, which corresponds to 5 minutes.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 300000 ' 5 minutes
wend
Its also advisable, to change iPercent > 95 to iPercent > 90, because the script does not alert you when battery is fully charged, i.e., at 100%. So if the charging rate from 95-100% is less than 5 minutes, you will never get an alert. For this reason, I recommend to change the level to 90%.
Save the above script as .vbs extension and make a startup entry in Windows.
Source:
http://blogs.technet.com/b/jhoward/archive/2013/04/24/get-an-alert-when-my-battery-reaches-95.aspx
http://www.addictivetips.com/windows-tips/get-alerts-when-your-laptop-battery-is-low-or-full/