Code:
@echo off
echo. & PowerShell "$AAA=@(Get-CimInstance -ClassName Win32_Battery | Measure-Object).Count -gt 0; Write-Host ' Battery Connected [Internal] :' $AAA" & echo.
echo. & PowerShell "$AAA=@(Get-CimInstance -ClassName Win32_Battery | Measure-Object).Count; Write-Host ' Batteries Installed [Total] :' $AAA"
PowerShell (Get-CimInstance -ClassName Win32_Battery ^| Select ^
@{L=' Name' ;E={;if([string]::IsNullOrWhiteSpace($_.Name)) {'-'} else {$_.Name}}}, ^
@{L=' Description' ;E={;if([string]::IsNullOrWhiteSpace($_.Description)) {'-'} else {$_.Description}}}, ^
@{L=' PnP Device ID' ;E={;if([string]::IsNullOrWhiteSpace($_.PNPDeviceID)) {'-'} else {$_.PNPDeviceID}}}, ^
@{L=' Creation Class Name' ;E={;if([string]::IsNullOrWhiteSpace($_.CreationClassName)) {'-'} else {$_.CreationClassName}}}, ^
@{L=' Device ID' ;E={;if([string]::IsNullOrWhiteSpace($_.DeviceID)) {'-'} else {$_.DeviceID.Trim() -Replace '\s ',' '}}}, ^
@{L=' Availability' ;E={;if([string]::IsNullOrWhiteSpace($_.Availability)) {'-'} else {$_.Availability}}}, ^
@{L=' Battery Recharge Time' ;E={;if([string]::IsNullOrWhiteSpace($_.BatteryRechargeTime)) {'-'} else {$_.BatteryRechargeTime}}}, ^
@{L=' Battery Status' ;E={;if([string]::IsNullOrWhiteSpace($_.BatteryStatus)) {'-'} else {$_.BatteryStatus}}}, ^
@{L=' Chemistry' ;E={;if([string]::IsNullOrWhiteSpace($_.Chemistry)) {'-'} else {$_.Chemistry.ToString() + ' [1=Other, 2=Unknown, 3=Lead Acid, 4=Nickel Cadmium, 5=Nickel Metal Hydride, 6=Lithium-ION, 7=Zinc Air, 8=Lithium Polymer]'}}}, ^
@{L=' Design Capacity' ;E={;if([string]::IsNullOrWhiteSpace($_.DesignCapacity)) {'-'} else {[Math]::Round($_.DesignCapacity / 1, 0).ToString('0,00# mWh')}}}, ^
@{L=' Design Voltage' ;E={;if([string]::IsNullOrWhiteSpace($_.DesignVoltage)) {'-'} else {[Math]::Round($_.DesignVoltage / 1, 0).ToString('0,00# mVolts')}}}, ^
@{L=' Last Error Code' ;E={;if([string]::IsNullOrWhiteSpace($_.LastErrorCode)) {'-'} else {$_.LastErrorCode}}}, ^
@{L=' Error Cleared' ;E={;if([string]::IsNullOrWhiteSpace($_.ErrorCleared)) {'-'} else {$_.ErrorCleared}}}, ^
@{L=' Error Description' ;E={;if([string]::IsNullOrWhiteSpace($_.ErrorDescription)) {'-'} else {$_.ErrorDescription}}}, ^
@{L=' Estimated Charge Remaining' ;E={;if([string]::IsNullOrWhiteSpace($_.EstimatedChargeRemaining)) {'-'} else {[Math]::Round($_.EstimatedChargeRemaining / 100, 2).ToString('0.00 %')}}}, ^
@{L=' Estimated Run Time Left' ;E={;if($_.EstimatedRunTime -eq '71582788') {'- [Running on ''AC Power'']'} else {$_.EstimatedRunTime.ToString() + ' [Minutes]'}}}, ^
@{L=' Expected Life' ;E={;if([string]::IsNullOrWhiteSpace($_.ExpectedLife)) {'-'} else {$_.ExpectedLife}}}, ^
@{L=' Expected Battery Life' ;E={;if([string]::IsNullOrWhiteSpace($_.ExpectedBatteryLife)) {'-'} else {$_.ExpectedBatteryLife}}}, ^
@{L=' Full Charge Capacity' ;E={;if([string]::IsNullOrWhiteSpace($_.FullChargeCapacity)) {'-'} else {[Math]::Round($_.FullChargeCapacity / 1, 0).ToString('0,00# mWh')}}}, ^
@{L=' Install Date' ;E={;if([string]::IsNullOrWhiteSpace($_.InstallDate)) {'-'} else {$_.InstallDate}}}, ^
@{L=' Max Recharge Time' ;E={;if([string]::IsNullOrWhiteSpace($_.MaxRechargeTime)) {'-'} else {$_.MaxRechargeTime}}}, ^
@{L=' Config Manager User Config' ;E={;if([string]::IsNullOrWhiteSpace($_.ConfigManagerUserConfig)) {'-'} else {$_.ConfigManagerUserConfig}}}, ^
@{L=' Config Manager Error Code' ;E={;if([string]::IsNullOrWhiteSpace($_.ConfigManagerErrorCode)) {'-'} else {$_.ConfigManagerErrorCode}}}, ^
@{L=' Power Management Supported' ;E={;if([string]::IsNullOrWhiteSpace($_.PowerManagementSupported)) {'-'} else {$_.PowerManagementSupported}}}, ^
@{L=' Power Management Capabilities';E={;if([string]::IsNullOrWhiteSpace($_.PowerManagementCapabilities)) {'-'} else {$_.PowerManagementCapabilities}}}, ^
@{L=' Smart Battery Version' ;E={;if([string]::IsNullOrWhiteSpace($_.SmartBatteryVersion)) {'-'} else {$_.SmartBatteryVersion}}}, ^
@{L=' System Creation Class Name' ;E={;if([string]::IsNullOrWhiteSpace($_.SystemCreationClassName)) {'-'} else {$_.SystemCreationClassName}}}, ^
@{L=' Time On Battery' ;E={;if([string]::IsNullOrWhiteSpace($_.TimeOnBattery)) {'-'} else {$_.TimeOnBattery}}}, ^
@{L=' Time To Full Charge' ;E={;if([string]::IsNullOrWhiteSpace($_.TimeToFullCharge)) {'-'} else {$_.TimeToFullCharge}}}, ^
@{L=' CIM Class' ;E={;if([string]::IsNullOrWhiteSpace($_.CimClass)) {'-'} else {$_.CimClass}}}, ^
@{L=' Status' ;E={;if([string]::IsNullOrWhiteSpace($_.Status)) {'-'} else {$_.Status}}}, ^
@{L=' Status Info' ;E={;if([string]::IsNullOrWhiteSpace($_.StatusInfo)) {'-'} else {$_.StatusInfo.ToString() + ' [1=Other, 2=Unknown, 3=Enabled, 4=Disabled, 5=Not Applicable]'}}} ^| ^
Format-List ^| Out-String -Width 1000)
echo. & echo ^>Press ANY key to EXIT . . . & pause >nul & Exit