Is there a way to detect weather my laptop is using the battery or
power-cable programatically in Windows Script? I have an IBM ThinkPad
A30 with Windows 2000 SP3 with a background service that takes up a
large processing power when activated. If possible, I'd like to
shut-down this service automatically whenever I un-plug the laptop,
then start it back up again when I plug it back in.
I have search the forum for solution and try to use WMI win32_battery
to get information on my Windows XP Pro, but it seems not work, for
the properitiers of "BatteryStatus", it just return "1 - Other" when
my notebook is using battery and return "2 - unknow" when I attach
power cable to my notebook, but it should return "charging" or "using
battery".
Why I want to get information of power status ? I want to
automatically install windows xp sp2 patch for all my office desktop
and notebook sliently , but it seems not work on notebook when it's
using battery power.
Is somebody can help me ? Thanks in advance.
Motor.