Batch file to toggle between balanced and high performance power plan


  1. Posts : 24
    windows 10
       #1

    Batch file to toggle between balanced and high performance power plan


    Is it possible to toggle between balanced and high performance power plan using a batch file ?

    powercfg -s 381b4222-f694-41f0-9685-ff5bb260df2e

    and

    powercfg -s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c

    When set to balanced, toggle to high performance and when set to high performance, toggle to balanced. Without creating 2 differents batch files.
      My Computer


  2. Posts : 68,997
    64-bit Windows 11 Pro for Workstations
       #2

    Hello XMcQcX,

    If you like, the tutorial below will let you add a context menu to make it east to change your power plan on demand.

    'Choose Power Plan' context menu - Add in Windows 10
      My Computers


  3. Posts : 456
    Windows 10
       #3

    This would be a simple batch that just switches between Balanced and High Performance:

    Code:
    @echo off
    
    
    
    set Balanced=381b4222-f694-41f0-9685-ff5bb260df2e
    
    set HighPerf=8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
    
    
    
    for /f "tokens=2 Delims=:(" %%a in ('powercfg /getactivescheme') do for /f %%b in ("%%a") do set Active=%%b
    
    
    
    if "%Active%"=="%Balanced%" (Powercfg /s "%HighPerf%") else (Powercfg /s "%Balanced%")
      My Computer


  4. Posts : 24
    windows 10
    Thread Starter
       #4

    ricardobohner said:
    This would be a simple batch that just switches between Balanced and High Performance:

    Code:
    @echo off
    
    
    
    set Balanced=381b4222-f694-41f0-9685-ff5bb260df2e
    
    set HighPerf=8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
    
    
    
    for /f "tokens=2 Delims=:(" %%a in ('powercfg /getactivescheme') do for /f %%b in ("%%a") do set Active=%%b
    
    
    
    if "%Active%"=="%Balanced%" (Powercfg /s "%HighPerf%") else (Powercfg /s "%Balanced%")
    Thank you very much ! It's working perfectly. I pinned a shortcut to the batch in the start menu. It's very quick.

    - - - Updated - - -

    Brink said:
    Hello XMcQcX,

    If you like, the tutorial below will let you add a context menu to make it east to change your power plan on demand.

    'Choose Power Plan' context menu - Add in Windows 10
    Thank you very much for your help. I don't want to touch the registry, I'm using ricardobohner's code.
      My Computer


  5. Posts : 68,997
    64-bit Windows 11 Pro for Workstations
       #5

    XMcQcX said:
    Thank you very much for your help. I don't want to touch the registry, I'm using ricardobohner's code.
    No worries. The downloadable .reg files in the tutorial will do all the work for you.

    'Choose Power Plan' context menu - Add in Windows 10
      My Computers


  6. Posts : 456
    Windows 10
       #6

    Cool, maybe you could use cortana to run the batch so you can switch power plan without touching your computer just by using voice command.
      My Computer


  7. Posts : 24
    windows 10
    Thread Starter
       #7

    Brink said:
    No worries. The downloadable .reg files in the tutorial will do all the work for you.

    'Choose Power Plan' context menu - Add in Windows 10
    ricardobohner said:
    Cool, maybe you could use cortana to run the batch so you can switch power plan without touching your computer just by using voice command.
    Just found the perfect app "PowerPlanSwitcher"
      My Computer


 

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

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




Windows 10 Forums