Computer Performance, Microsoft Windows 7

Guy recommends:
Free config generator

Solarwinds Config Generator

This CG will put you in charge of controlling changes to network routers and other SNMP devices.

Download your free Config Generator



Windows 7 Powercfg -energy for Sleep Management

Windows 7 Powercfg -energy for Sleep Management

Windows 7 has a new switch for the built-in Powercfg command, it's called -energy.  Appending this switch is invaluable when troubleshooting sleep problems, particularly on Windows 7 laptop or notebook computers.

Topics for Windows 7 Powercfg -energy

 ♦

Guy's Rule for Laptops and Notebooks
Every Laptop Gives One of These Problems with Power Management

  • Won't wake up from sleep or hibernate.
  • Wakes up when you don't want it to!
  • Cannot set at least one of: Sleep, Hibernate or Standby.
  • Battery is flat after 40 minutes of solid typing.

Control Panel Applets - E.g. Power Options

Every Control Panel applet, including the Power Options cpl, has at least 4 alternative ways of changing its settings.

  1. GUI - It's always worth LOOKING at the settings and getting a feel of what's possible.
  2. Registry - Essential where there is no GUI for a setting.
  3. Group Policy - Especially useful for setting multiple machines in a domain.
  4. Scripting with PowerShell (or VBScript).
  5. Built-in Command line utility, such as powercfg.

If you are going to examine the settings of an item in the Control Panel then only a DOS extremist would eschew at least take a peak at the GUI.  If you are troubleshooting, and the GUI does not get the job done, then where do you turn next?  Probably the Group Policy editor, or maybe the Registry.  Yet in the case of Power Options I would place the command line powercfg as the number 2 tool for examining sleep and hibernation settings.

Guy's Observations on Windows 7 Powercfg

  • Powercfg is more than just a toy.  It's a worthy alternative to the Control Panel's Power Management GUI.
  • Useful for troubleshooting Power problems such as won't wake from sleep or hibernate.
  • Handy to see which devices are supposed to wake a sleeping computer.
  • Gives an insight into the design and inter-relationship between the sleep components.
  • Leads you to think, 'How could I use the command line to automate?' 
  • Prompts you to deduce, 'There must group policies to control sleep'.
  • Laptops have special settings / commands / challenges when running on their battery.

Getting Started with Powercfg

I start by clicking the Start Orb, Type 'cmd', remembered to right-click and 'Run as administrator'.  Now I am ready to type the command powercfg.  Actually one of the first switches I use is the ubiquitous -?  Next I recommend trying the -devicequery switch.  I mention this because it initially I could not get it to work, then I realized that: powercfg -devicequery needed another parameter for example:

powercfg -devicequery wake_up_from_S3_supported
or
powercfg -devicequery wake_from_any

The reason that I chose this example was to encourage you study the help (powercfg -?), and thus get into the rhythm of this command.  powercfg -MainSwitch Further_refinement.  If you can do this then I declare you an expert on Powercfg, and I wish you good luck in researching your specific sleep or hibernate problem.

Guy Recommends: SolarWinds Engineer's Toolset v10Engineer's Toolset v10

The Engineer's Toolset v10 provides a comprehensive console of utilities for troubleshooting computer problems.  Guy says it helps me monitor what's occurring on the network, and the tools teach me more about how the system itself operates.

There are so many good gadgets, it's like having free rein of a sweetshop. Thankfully the utilities are displayed logically: monitoring, discovery, diagnostic, and Cisco tools.  Download your copy of the Engineer's Toolset v 10

Troubleshooting Windows 7 with powercfg -energy

The secret of success is that once this command 'powercfg -energy' completes, you type, 'energy-report.html'.  Now you should see a browser pane with detailed information about what happens when the laptop tries to sleep.

My first point is that the powercfg command is harsh on errors.  Even machines that seem to be working fine generate at least 3 Errors.  The reason that I recommend running powercfg -energy is to set you on the correct path when trying to track down a serious sleep or hibernate problem.

Trap 1 The command: powercfg -energy only works with Windows 7 (Not Windows Server 2008)

Trap 2 The energy-report.html file is created in the current directory.  Guy thought that it was always created in the \windows\system32 folder - wrong.  These days before I create a report with -energy I cd: to a folder on my e:\ drive.

Bonus - Check Your Battery Capacity Status

Look for a similar entry at the bottom of your report.

Battery:Battery Information
Battery ID Sony Corp.
Manufacturer Sony Corp.
Serial Number
Chemistry LiOn
Long Term 1
Design Capacity 57720
Last Full Charge 57720

More Troubleshooting Ideas

Try:
powercfg -lastwake
or
powercfg -devicequery wake_armed

Guy Recommends: SolarWinds LANSurveyorSolarwinds LANSurveyor

LANSurveyor will produce a neat diagram of your network topology.  But that's just the start; LANSurveyor can create an inventory of the hardware and software of your machines and network devices.  Other neat features include dynamic update for when you add new devices to your network.  I also love the ability to export the diagrams to Microsoft Visio.

Finally, Guy bets that if you take a free trial of LANSurveyor then you will find a device on your network that you had forgotten about, or someone else installed without you realizing!

Download a Free Trial of LANSurveyor

PowerCfg Registry Values

I have found these two settings in the registry, but I am not impressed they don't seem to 'work'.   Normally I love tweaking the registry, but in the case of powercfg, it's the command line that gets the job done for me.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg

HKEY_CURRENT_USER\Control Panel\PowerCfg

If we research CurrentPowerPolicy, then I have discovered two contradictory explanations.  I say again, this was a fruitless journey for me, but if you make sense of these values, then please do let me know.

0 - Home/Office desktop
1 - Portable/Laptop computer
2 - Monitor on for presentations
3 - Network computer (no Wake-on-LAN)
4 - Optimized for high performance
5 - Optimized for power saving

Index Power setting type For use on
0 Power Saver AC
1 Power Saver DC
2 Balanced AC
3 Balanced DC
4 High Performance AC
5 High Performance DC

Summary of Windows 7 Powercfg -energy

Windows 7 has a new switch for the built-in Powercfg command, it's called -energy.  This technique is invaluable for troubleshooting sleep problems, particularly on Windows 7 laptop or notebook computers.

 

Microsoft Windows Version 7 Configuration Topics

 *


Google

WebThis Site

Guy Recommends: WMI Monitor and It's Free!Solarwinds WMI Monitor

Windows Management Instrumentation (WMI) is one of the hidden treasures of Microsoft operating systems.

Fortunately, Solarwinds have created the WMI Monitor so that you can examine these gems of performance information for free.  Take the guess work out of which WMI counters to use for applications like Microsoft Active Directory, SQL or Exchange Server.

Download your free copy of WMI Monitor

 

Home Copyright © 1999-2010 Computer Performance LTD All rights reserved

Please report a broken link, or an error.