Copy the text in the following code block into Notepad.
Save it on the desktop as
BatCheck.vbs. Be sure to change the
Save as Type: box to
All Files when saving.
Code:
[plain]strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\wmi")
Set colItems = objWMIService.ExecQuery("Select * From BatteryStatus Where Voltage > 0")
For Each objItem in colItems
If objItem.PowerOnline = True Then
Msgbox "Running On Battery" & vbCRLF & "Remaining capacity: " & objItem.RemainingCapacity, vbOkOnly + vbCritical + vbSystemModal
End If
Next
[/plain]
While connected to AC power with the battery fully charged, double click the file to run it.
It will display a popup saying you are running on battery, and a Remaining capacity number. I need the number when the battery is fully charged. Then I can modify this a bit so it will display percent remaining. Then we run the modified script as a scheduled task every 5-10 minutes, and only display the popup when the percentage drops below whatever number you want.