View/Change Power Plan via Registry?


  1. Posts : 27
    Windows 7 Home Premium x64
       #1

    View/Change Power Plan via Registry?


    Hello all,
    I'm working on a little Visual Basic .NET program that simply changes the power plan based upon the AC power status and battery percentage status (something that Windows 7 should already do...)
    Anyway, it's coming along well enough, except that I need to have my program run the 'powercfg' command line utility to change plans. I have yet to find a way for my program to determine which plan is in use.
    Is there a registry key that changes the current power plan or something similar, or do I need to play around with grabbing outputs from the command line?

    Thanks in advance!
      My Computer


  2. Posts : 16,155
    7 X64
       #2

    You can find which is the current plan here:

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\User\Default\PowerSchemes]
    "ActivePowerScheme"="381b4222-f694-41f0-9685-ff5bb260df2e"

    For the description:

    D:\Windows\System32>REG QUERY HKLM\SYSTEM\CurrentControlSet\Control\Power\User\D
    efault\PowerSchemes\381b4222-f694-41f0-9685-ff5bb260df2e

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\User\Default\PowerSche
    mes\381b4222-f694-41f0-9685-ff5bb260df2e
    Description REG_EXPAND_SZ @%SystemRoot%\system32\powrprof.dll,-14,Auto
    matically balances performance with energy consumption on capable hardware.
    FriendlyName REG_EXPAND_SZ @%SystemRoot%\system32\powrprof.dll,-15,Bal
    anced (recommended)
      My Computers


  3. Posts : 27
    Windows 7 Home Premium x64
    Thread Starter
       #3

    GAH!

    Thank you!!!
    This is going to be a whole lot easier now!

    (I can't believe I didn't see that...)
      My Computer


  4. Posts : 16,155
    7 X64
       #4

    You're welcome.
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 16:24.
Find Us