A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » General XP issues or comments
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Applet to record battery strength every 30 minutes



 
 
Thread Tools Display Modes
  #1  
Old September 3rd 10, 04:09 AM posted to microsoft.public.windowsxp.general
Prof Wonmug[_2_]
external usenet poster
 
Posts: 8
Default Applet to record battery strength every 30 minutes

Where could I get an applet that would wake up every 30 minutes, read
the battery strength on my laptop, and write the results to a file?

I looked at several shareware apps that monitor the battery, but
didn't see any that can make a log.

Any suggestions or pointers?
Ads
  #2  
Old September 3rd 10, 09:09 AM posted to microsoft.public.windowsxp.general
Olorin
external usenet poster
 
Posts: 323
Default Applet to record battery strength every 30 minutes


"Prof Wonmug" wrote in message
...
Where could I get an applet that would wake up every 30 minutes, read
the battery strength on my laptop, and write the results to a file?

I looked at several shareware apps that monitor the battery, but
didn't see any that can make a log.

Any suggestions or pointers?


"And your question about Windows XP is....?"


  #3  
Old September 3rd 10, 09:09 AM posted to microsoft.public.windowsxp.general
Olorin
external usenet poster
 
Posts: 323
Default Applet to record battery strength every 30 minutes


"Prof Wonmug" wrote in message
...
Where could I get an applet that would wake up every 30 minutes, read
the battery strength on my laptop, and write the results to a file?

I looked at several shareware apps that monitor the battery, but
didn't see any that can make a log.

Any suggestions or pointers?


"And your question about Windows XP is....?"


  #4  
Old September 3rd 10, 10:28 AM posted to microsoft.public.windowsxp.general
Pegasus [MVP]
external usenet poster
 
Posts: 2,361
Default Applet to record battery strength every 30 minutes



"Prof Wonmug" wrote in message
...
Where could I get an applet that would wake up every 30 minutes, read
the battery strength on my laptop, and write the results to a file?

I looked at several shareware apps that monitor the battery, but
didn't see any that can make a log.

Any suggestions or pointers?


You could do it like this:
1. Save the code below as c:\Windows\BatteryMonitor.vbs
2. Create a scheduled task that runs once every 30 minutes. It should
execute the following command:
cscript //nologo c:\Windows\BatteryMonitor.vbs
c:\Windows\BatteryMonitor.log
3. Examine the log file c:\Windows\BatteryMonitor.log

Note that the battery interface appears to differ somewhat between
manufacturers. The code works on my Acer laptop but it may fail on your own
machine.

Set oWMIService = GetObject("winmgmts:\\.\root\CIMV2")
Set cItems = oWMIService.ExecQuery( _
"SELECT * FROM Win32_Battery",,48)
For Each oItem In cItems
sOutput = Date() & " " & Time() & ": " _
& "Remaining charge=" & oItem.EstimatedChargeRemaining & "%"
If oItem.BatteryStatus = 1 _
Then sOutput = sOutput & ", Remaining time=" & oItem.EstimatedRunTime & "
minutes"
WScript.Echo sOutput
Next


  #5  
Old September 3rd 10, 10:28 AM posted to microsoft.public.windowsxp.general
Pegasus [MVP]
external usenet poster
 
Posts: 2,361
Default Applet to record battery strength every 30 minutes



"Prof Wonmug" wrote in message
...
Where could I get an applet that would wake up every 30 minutes, read
the battery strength on my laptop, and write the results to a file?

I looked at several shareware apps that monitor the battery, but
didn't see any that can make a log.

Any suggestions or pointers?


You could do it like this:
1. Save the code below as c:\Windows\BatteryMonitor.vbs
2. Create a scheduled task that runs once every 30 minutes. It should
execute the following command:
cscript //nologo c:\Windows\BatteryMonitor.vbs
c:\Windows\BatteryMonitor.log
3. Examine the log file c:\Windows\BatteryMonitor.log

Note that the battery interface appears to differ somewhat between
manufacturers. The code works on my Acer laptop but it may fail on your own
machine.

Set oWMIService = GetObject("winmgmts:\\.\root\CIMV2")
Set cItems = oWMIService.ExecQuery( _
"SELECT * FROM Win32_Battery",,48)
For Each oItem In cItems
sOutput = Date() & " " & Time() & ": " _
& "Remaining charge=" & oItem.EstimatedChargeRemaining & "%"
If oItem.BatteryStatus = 1 _
Then sOutput = sOutput & ", Remaining time=" & oItem.EstimatedRunTime & "
minutes"
WScript.Echo sOutput
Next


  #6  
Old September 5th 10, 01:01 PM posted to microsoft.public.windowsxp.general
Eddie
external usenet poster
 
Posts: 82
Default Applet to record battery strength every 30 minutes

Olórin wrote:
"Prof Wonmug" wrote in message
...
Where could I get an applet that would wake up every 30 minutes, read
the battery strength on my laptop, and write the results to a file?

I looked at several shareware apps that monitor the battery, but
didn't see any that can make a log.

Any suggestions or pointers?


"And your question about Windows XP is....?"


---------------------

If you look at Pegasus's reply, you will realise it is also about ppl
helping ppl.

Ed
  #7  
Old September 5th 10, 01:01 PM posted to microsoft.public.windowsxp.general
Eddie
external usenet poster
 
Posts: 82
Default Applet to record battery strength every 30 minutes

Olórin wrote:
"Prof Wonmug" wrote in message
...
Where could I get an applet that would wake up every 30 minutes, read
the battery strength on my laptop, and write the results to a file?

I looked at several shareware apps that monitor the battery, but
didn't see any that can make a log.

Any suggestions or pointers?


"And your question about Windows XP is....?"


---------------------

If you look at Pegasus's reply, you will realise it is also about ppl
helping ppl.

Ed
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off






All times are GMT +1. The time now is 10:09 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.