Two Ways to Automate Power Behavior
Windows already reacts to being unplugged in a limited way — Battery Saver kicks in below a percentage threshold, and per-plan settings dim the screen and sleep the disk after a timeout. But if you want something more deliberate, like immediately switching to a stricter power plan the instant AC power is removed rather than waiting for a battery percentage threshold, you need to trigger an action off the power source change event itself. Windows logs that event, and Task Scheduler can react to it. This guide covers both the built-in Battery Saver configuration and the more aggressive Task Scheduler automation.
Part 1: Configuring Built-In Battery Saver
- Open Settings → System → Power & battery.
- Expand Battery Saver.
- Set Turn battery saver on automatically at to a higher percentage than the default 20% — 50% or even "Always" if you want it active on every unplug regardless of charge level.
- Under the same page, check Power mode and set it to Best power efficiency when you expect to run unplugged often — this throttles background CPU behavior and reduces performance in exchange for battery life.
Battery Saver alone reduces background sync frequency, mail push, and certain visual effects, but it won't force a CPU downclock or change display refresh rate on its own — for that you need to pair it with a specific power plan.
Part 2: Auto-Switching Power Plans on Unplug
The most reliable way to force a specific plan (and by extension CPU throttling, since power plans control processor minimum/maximum state) the instant AC is removed is a Task Scheduler task triggered directly off the power source change event, rather than waiting on a battery percentage.
Step 1: Find Your Power Plan GUIDs
Open an elevated Command Prompt and list your available plans:
powercfg /list
Note the GUID next to Power saver (or a custom plan you've created) and the one next to your normal plugged-in plan, e.g. Balanced.
Step 2: Create the "On Battery" Task
- Open Task Scheduler (
taskschd.msc). - Click Create Task (not Basic Task — you need the custom event trigger).
- On the General tab, name it something like "Switch to Power Saver on Unplug" and check Run with highest privileges.
- On the Triggers tab, click New, set Begin the task to On an event, choose Custom, and click New Event Filter.
- Set Log to
Systemand Source toMicrosoft-Windows-Kernel-Power, then under Event IDs enter105(this is the power source change event, logged every time you plug or unplug). - On the Actions tab, click New, set Action to Start a program, and enter:
Program/script: powercfg Arguments: /setactive <power-saver-GUID> - Save the task.
Step 3: Create the Matching "On AC Power" Task
Repeat the same process for restoring your normal plan when AC is reconnected — same Event ID 105 trigger, but pointing the action at your Balanced or High Performance plan's GUID instead. Without this second task, your machine stays in Power Saver even after you plug back in.
AcOnline data field, or accept the simpler (if slightly redundant) approach of pointing both tasks at powercfg /setactive with mutually exclusive target plans — worst case one no-ops because you're already on that plan.What This Won't Do: Display Refresh Rate
Power plans control CPU min/max processor state, display timeout, and sleep behavior, but Windows doesn't expose per-plan display refresh rate switching through powercfg — that's a separate setting under Settings → System → Display → Advanced display, and on most laptops with a 120Hz+ panel, dynamic refresh rate switching (if the panel and driver support it) already happens automatically based on content and power state without any scripting needed. Check Display → Advanced display → Choose a refresh rate for a Dynamic option if your hardware supports it.
Verifying the Automation Works
Unplug your laptop and check the active plan immediately:
powercfg /getactivescheme
It should report the Power Saver GUID within a second or two of unplugging. Plug back in and run it again to confirm it swaps back.
Wrap-Up
Battery Saver's percentage-based trigger is fine for casual use, but if you want power behavior to change the instant you're unplugged rather than after your battery drops below a threshold, the Task Scheduler + powercfg combination gives you that immediate, deterministic switch — and it's a one-time five-minute setup that runs silently in the background forever after.
Discussion & Insights