Check Laptop Battery Charge and Status from the Command Line

Read the current battery percentage, charging status and estimated remaining runtime in PowerShell with Win32_Battery.

WindowswmiPower & SleepbatteryLow risk
Run `Get-CimInstance Win32_Battery | Select-Object EstimatedChargeRemaining, BatteryStatus, EstimatedRunTime` in PowerShell.

01Command

Command
$ Get-CimInstance Win32_Battery | Select-Object EstimatedChargeRemaining, BatteryStatus, EstimatedRunTime

02What it does

The battery flyout in the taskbar is fine for a glance, but scripts and remote sessions need the numbers programmatically. Win32_Battery reports EstimatedChargeRemaining as a percentage, a BatteryStatus code (2 means on AC power, 1 means discharging), and EstimatedRunTime in seconds of remaining life at the current drain. It works on laptops and tablets; desktops simply return nothing.

03Risk

RiskLow risk

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-19 · Category: System & Settings

06Related solutions