Simple power plan manager for Windows computers, written in C.
Note: Power plans have been removed from Windows 10 in 2018, so this program is only useful for Windows versions 2017 or older.
It turns out Windows power plans will change performance settings a lot to conserve power. When used together with the Battery Saver mode on Windows 10 you can save a lot of battery.
But Windows does not offer a way to automatically switch power plans. To solve this problem, I have written a C program that does just that.
And the best part? It uses virtually no system resources. 0% CPU and 0.3MB RAM.
It’s also 32 bit and should work on most versions of windows.
How to install (read carefully)
I don’t provide an installer, so here are the manual instructions. Also, antivirus will most definitely give a false positive, so white-list the program. If this doesn't work, you will need to compile it yourself. See further below for compilation instructions.
- Download the release.
- Extract the zip and move the
C:\Program Files (x86).It will not work correctly if you don’t do this.
- Don’t take anything out of the
powermanfolder. If you want a desktop shortcut for this, copy the shortcut (but don’t move it) to the desktop
- To run the program, double click the shortcut (not the .exe). The shortcut sets up the app icon and window sizes and other niceties, and starts the program minimized.
- Add the program to your startup list, so that it runs automatically when the computer starts [optional, but recommended]
- Open the start menu, and type
run. Select the Run application.
- In the box that pops up, type
- Copy the powerman shortcut (but don’t move it) to the File Explorer window that just opened
- Open the start menu, and type
How to configure
Powerman comes with a configuration file named
powerman_config.txt. In this file are the settings for the program. The screenshot below describes its structure:
- Line 1: the battery level at which the power plan is set to Lower Power Mode. If the charge is above this value, Powerman will set the power plan to Balanced.
- Line 2: the battery level at which the power plan is set to Balanced. If the battery level goes above this value, Powerman will set the power plan to High Performance.
- Line 3: the refresh rate of the program, in milliseconds. This regulates how often the program checks the battery level. For 1 second, put 1000. For 3 minutes, put 180000.
- Lower numbers mean higher refresh rates. I do not recommend anything lower than 1 minute (60000).
- Lines 4-6: the GUIDs of the power plans to use. You don’t need to modify these, unless you have a custom power plan you want to use instead. To get the GUID for your custom power plan:
- Right-click the battery icon in your taskbar and press Windows Mobility Center
- For each power plan in the power list that you want to use:
- Enable the power plan
- In a command prompt window, type
- Copy everything up to the
- Paste in the
powerman_config.txtreplacing an existing GUID (don’t add any new lines to the file!)
DO NOT remove lines or add extraneous data into this file! Powerman will not start if this file is invalid! If the config file is missing, Powerman has hard-coded defaults it will use instead. Also don’t put commas in the numbers. To Powerman, 1000 is a number, but 1,000 is a string it can’t use. It will behave erratically if it doesn’t get proper data.
Reset the config file
Paste the following into
powerman-config.txt to reset your settings:
0 70 180000 a1841308-3541-4fab-bc81-f71556f20b4a 381b4222-f694-41f0-9685-ff5bb260df2e 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
Compiling it yourself
Ensure you have the visual Studio C compiler
- Clone this repository and extract the zip
- Open cmd and
cdinto the powerman folder
- If the command prompt reports that cl is not a recognized command, then try the above in the Developer Command Prompt