Bill Seven
Bill Seven

Reputation: 768

How get real time voltage?

Is there a way to retrieve the voltage being supplied to a computer in real time?

Upvotes: 0

Views: 696

Answers (1)

Seth
Seth

Reputation: 46453

You can use WMI to get some of that information. I used the WMI Code Creator to come up with this VB script which returns the Win32_Processor CurrentVoltage value. If you have a laptop, there is also some battery information available in WMI.

strComputer = "." 
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") 
Set colItems = objWMIService.ExecQuery( _
    "SELECT * FROM Win32_Processor",,48) 
For Each objItem in colItems 
    Wscript.Echo "-----------------------------------"
    Wscript.Echo "Win32_Processor instance"
    Wscript.Echo "-----------------------------------"
    Wscript.Echo "CurrentVoltage: " & objItem.CurrentVoltage
Next

Upvotes: 1

Related Questions