Why? I removed a few of these because I don't need them.
From the rest, I'm only retrieving Availability, Battery Status, Creation Class Name, Design Voltage, Device ID,
Estimated Charge Remaining, Estimated Run Time, Status, System Creation Class Name, and System Name, and am not sure why.
http://msdn.microsof...5(v=VS.85).aspx
http://msdn.microsof...4(v=vs.85).aspx
Perhaps someone else would like to try.
On a separate note, this is useful for those who'd like to code battery life information into a GUI (Or with GDI+ or combination of both).
Credit for this idea goes to user shajul.
strComputer := "." objWMIService := ComObjGet("winmgmts:{impersonationLevel=impersonate}!\\" . strComputer . "\root\cimv2") colItems := objWMIService.ExecQuery("Select * from Win32_Battery")._NewEnum While colItems[objItem] MsgBox % "Availability: " . objItem.Availability . "`nBattery Recharge Time: " . objItem.BatteryRechargeTime . "`nBattery Status: " . objItem.BatteryStatus . "`ncaption: " . objItem.Caption . "`nChemistry: " . objItem.Chemistry . "`nConfig Manager Error Code: " . objItem.ConfigManagerErrorCode . "`nCreation Class Name: " . objItem.CreationClassName . "`nDescription: " . objItem.Description . "`nDesign Capacity: " . objItem.DesignCapacity . "`nDesign Voltage: " . objItem.DesignVoltage . "`nDevice ID: " . objItem.DeviceID . "`nEstimated Charge Remaining: " . objItem.EstimatedChargeRemaining . "`nEstimated Run Time: " . objItem.EstimatedRunTime . "`nExpected Battery Life: " . objItem.ExpectedBatteryLife . "`nExpected Life: " . objItem.ExpectedLife . "`nFull Charge Capacity: " . objItem.FullChargeCapacity . "`nMax Recharge Time: " . objItem.MaxRechargeTime . "`nName: " . objItem.Name . "`nPNP Device ID: " . objItem.PNPDeviceID . "`nSmart Battery Version: " . objItem.SmartBatteryVersion . "`nStatus: " . objItem.Status . "`nStatus Info: " . objItem.StatusInfo . "`nSystem Creation Class Name: " . objItem.SystemCreationClassName . "`nSystem Name: " . objItem.SystemName . "`nTime On Battery: " . objItem.TimeOnBattery . "`nTime To Full Charge: " . objItem.TimeToFullCharge