[SOLVED] Any formula to get the battery health for a Windows laptop using Command Line?

Rodion15

Distinguished
Sep 11, 2011
760
7
19,015
Hi,

I thought you may get the health state for a laptop battery using the CMD command: powercfg /batteryreport (see picture)

How should I interpret the data to learn the battery health for any laptop battery?

Thanks in advance
This is just an example, I'd like to know this for any battery:

Z5UkT05.png
 
Solution
Powershell:

(Get-WmiObject -Class "BatteryFullChargedCapacity" -Namespace "ROOT\WMI").FullChargedCapacity

(Get-WmiObject -Class "BatteryStaticData" -Namespace "ROOT\WMI").DesignedCapacity

Outputs mWh I believe, I am sure that is how that GUI is getting it.

You can get fancy and assign them to variables and then do the math, but first divided by the last will get you percentage health basically.

Not sure about cycle count.

Eximo

Titan
Ambassador
Powershell:

(Get-WmiObject -Class "BatteryFullChargedCapacity" -Namespace "ROOT\WMI").FullChargedCapacity

(Get-WmiObject -Class "BatteryStaticData" -Namespace "ROOT\WMI").DesignedCapacity

Outputs mWh I believe, I am sure that is how that GUI is getting it.

You can get fancy and assign them to variables and then do the math, but first divided by the last will get you percentage health basically.

Not sure about cycle count.
 
Solution