Re: Detecting Battery Mode programatically

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Scott Fenstermacher (sfenstermacher_at_lrs.com)
Date: 12/30/04


Date: Thu, 30 Dec 2004 14:51:51 -0600

Actually, IIRC, Service Pack 2 already has code to prevent installing if the
system is running on battery power... Try it.

-- 
Scott Fenstermacher
Network Engineer
Levi, Ray and Shoup, INC
"Motor Wu" <motorwu@kimo.com> wrote in message 
news:mea8t0hi663pjug99dal53t7761vjgqr6k@4ax.com...
> 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. 


Relevant Pages

  • What I learned from Hurricane Charley
    ... Since we never lost power, I'm not sure about the level of our food and ... Since emergency shelter in the county in which I work (and to which I must ... In the late spring we had pulled out our battery operated drill and used it ... we could safely handle the panels without injury to our hands. ...
    (misc.survivalism)
  • Re: Notebook wont power on
    ... There is no commonality between episodes (it never hibernated or went into standby before being shutdown, the battery never died, it is plugged in when it is shutdown, it is not plugged in when it shuts down, etc). ... problem when on battery is that the notebook is totally dead. ... The problem when the notebook is on AC is that the various buttons light up (all but the power button) and the notebook won't boot. ... put the battery back in and you are good for about another 5 boots. ...
    (microsoft.public.windowsxp.general)
  • Re: UPS waveform question for SUN servers
    ... O.K. The pure sine wave is better for systems with input ... The SB-1K and SB-2K use the same power supply. ... this UPS has caused more trouble than ... it has alleviated - with the battery sometimes discharging for no ...
    (comp.sys.sun.hardware)
  • Re: Redox batteries
    ... When you say that charging will use a fraction of the power of the generator because most of it is used by the propulsion, you are right when you consider riding at nominal speed. ... In this case, what I need is having the generator run for one hour at full power, then quietly ride using the batteries only for ten hours. ... You do not need to modify the charger itself - it bases lowering the current on voltage only, and "relaxing" will make sure that battery voltage will not go high enough to start throttling down the current. ... it does not matter how to charge it as long as you do not cause ...
    (sci.chem.electrochem.battery)
  • Re: 12v TV
    ... what was being pointed out is that the mains power supply outpts 12 volts... ... hence the TV's components are made using the lowest tollerance parts available, no need to use more expensive higher voltage parts when the TV will never see more than 12.3 volts. ... as a fair few people found out tho, plugging it into the caravans battery directly... ... i have a large solar array on my vans roof, and it does an equalizing charge every month, takes the batteries upto 16 volts for a few hours to balance them all out and stir up the cells, my Tv would have let the magic smoke out first time it did that for sure. ...
    (uk.rec.caravanning)