"Andrzej W." <awa_wp.a_to_wytnij.@wp.pl> said this in news item
news:hjkpi4$c9k$...
> W dniu 2010-01-25 11:55, Pegasus [MVP] pisze:
>>
>>
>> "Andrzej W." <awa_wp.a_to_wytnij.@wp.pl> said this in news item
>> news:hjjlht$2ge$...
>>> Hi,
>>>
>>> How to activate DC power plan on desktop computer without a battery
>>> and how to switch between AC and DC power plane?
>>
>> Is this an electrical or a scripting question? If it is a scripting
>> question then please elaborate.
>
> Sorry for my English...
>
> I would like to convince a Windows (server 2008) that it work on DC power
> not AC.
> Switching from AC to DC stops automatically selected programs started from
> task scheduler and hold down some programs which support power management.
> If I can't switch power plane from AC to DC I have to stop each of this
> program separately.
>
>
> --
> Best regards,
> Andrzej
I do not know if Server 2008 has a facility to switch between mains and
battery power under software control. If it has then it would be included in
WMI. The following WMI script does the opposite: It tells you if a machine
runs on mains or battery power.
Set oWMIService = GetObject("winmgmts:\\.\root\CIMV2")
Set cItems = oWMIService.ExecQuery( _
"SELECT * FROM Win32_Battery",,48)
For Each oItem in cItems
if oItem.BatteryStatus = 1 then
wscript.echo "Server runs on battery power"
else
wscript.echo "Server runs on mains power"
end if
Next
|