Posts Tagged ‘power’

Troubleshoot and Improve power usage on Windows 7

Wednesday, May 2, 2012 posted by CSch

Windows 7 has a troubleshooter taking care of power usage for notebooks as well as for desktop computers, it is quite hard to find however since you won’t find it in your Control Panel’s Power Options section. To access it,

- open the Control Panel and enter System and Security.
- In the topmost Action Center section, select Troubleshoot common computer problems.
- In the last menu entry, System and Security, select Improve power usage.

By clicking on Advanced, all problems found will automatically be corrected. You start the process by clicking on Next – if there have been problems they will be displayed along with a notice if they have been corrected or not. Click on Detailed information to view all the points that the troubleshooter has messed with or not:

Windows 7 comes with the Aero skin by default which might look nice but consumes a great deal of resources – and with them, power. I have experienced a loss of up to two hours of battery life on my notebook when turning Aero on which one can get back by switching to the classic skin – that ugly gray one, that was used in the times before Windows XP.

It would be great if Windows provided an option to set a scheduled task to trigger on plugging or unplugging the power supply or to configure the power settings to change themes automatically but unfortunately we don’t have that luxury, so we have to do it ourselves, in a slightly less elegant way.

What you need is a small VBScript which you can find here and a PowerShell script which checks in what state the notebook battery is in. To create that script, open a new notepad and paste the following into it:

$sav = (Get-WmiObject -Class Win32_Battery -ea 0).BatteryStatus
while ($true)
{
start-sleep -s 5
if (((Get-WmiObject -Class Win32_Battery -ea 0).BatteryStatus -eq (1 -or 3 -or 4 -or 5 -or 10 -or 11)) -and ((Get-WmiObject -Class Win32_Battery -ea 0).BatteryStatus -ne $sav))
{
& ‘C:\Windows\Resources\Ease of Access Themes\Classic.theme
$sav = (Get-WmiObject -Class Win32_Battery -ea 0).BatteryStatus
}
else
{
if ((Get-WmiObject -Class Win32_Battery -ea 0).BatteryStatus -ne $sav)
{
& ‘C:\Windows\Resources\Themes\Aero.theme
$sav = (Get-WmiObject -Class Win32_Battery -ea 0).BatteryStatus
}}}

Adjust the paths printed bold to the location of the themes you want to use if you want different ones (the first one is the one that is applied on unplugging the supply, second is for replugging). Save the script as a .ps1 file. If you haven’t yet created the VBScript, do it now following the above link. Remember to adjust the path to the ps1 script used there to yours. If you now launch the VBScript the PowerShell script should be started silently. If you get an error or the script won’t start, you first have to configure your system to allow executing PowerShell scripts – see the instructions below the code provided here.

The locations of the themes are
C:\Windows\Resources\Ease of Access Themes for the classic styled themes.
C:\Windows\Resources\Themes for preconfigured Aero style themes and
C:\Users\[YourUsername]\AppData\Local\Microsoft\Windows\Themes for custom themes (the AppData folder is hidden by default).

To automate everything you can set the execution of your VBScript as a scheduled task. Do so by entering Task Scheduler into your Start-menu search bar. Set up the task for execution on start up if you want it to be run on every session.

Save Power On Screen Lock (Windows 7)

Wednesday, November 23, 2011 posted by CSch

The reason to lock your screen (Windows key + L) usually is that you leave your computer, meaning it would be reasonable to turn off everything else there is on your computer as the sound or your screen as well. MonitorES is a utility that does this for you whenever you lock your screen.

It turns off the screen, mutes your computer, pauses any media playing and changes your IM status to “Away” if you want it. Download it on http://code.google.com/p/monitores/

View Detailed Power Efficiency Analysis (Windows 7)

Friday, November 4, 2011 posted by CSch

Windows 7 comes along with a helpful command-line utility that lets you view your computer’s power efficiency. It provides you with information about your processor utilisation, the processes taking up the most CPU resources, your current power plan and, if there are any, errors and warnings about your efficiency. To access it, open a command line window by entering cmd into a Run… prompt. The basic command to use is

powercfg

To get more information, use the question-mark switch like this: “powercfg -?” (leave out the quotes). The function we want to use however is (close all other windows and programs if possible before you do this)

powercfg -energy

This command will watch your computer for 60 seconds and then save a *.html file with a report in the location where you ran the command line (which should be your user’s folder by default):