How to auto shutdown laptop on AC power loss
Solution 1
I would go to Power Options > "Create a power plan". Call it "Night Time", and use any of the preconfigured power plans as a template.
On the next screen where you get the options "Turn off the display" and "Put the computer to sleep", choose "Change advanced power settings".
In the new window, set "Low battery level" to 99% and choose "Shut down" for "Low battery action".
I would just warn you though, by using this method, you need to make sure you quickly change back when you restart the computer otherwise it will just turn itself off again.
I would recommend that you type the following - powercfg -list
from the command line and take a copy of the GUID of your main plan, then, I recommend you create a scheduled task to run at system startup that looks similar to this (for high performance): powercfg.exe /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
If your house is anything like mine, I get little power cuts that last around 5 minutes once every few weeks - to counter this, consider using 80% or similar as the shut off percentage.
Hope this helps!
Solution 2
Use Shutter. Its portable, 1.73 MB small and free for personal use.
Once started, it runs in the tray and waits for certain events to execute predefined actions
For your scenario use:
- Event:
Battery below 99%
andTrigger event only when running on battery
- Action:
Shutdown
Laptop andForce
applications to stop
Related videos on Youtube
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Admin
Updated on September 18, 2022Comments
-
Admin almost 2 years
I'm using Windows 7 64-bit Home Edition on a Dell Inspiron.
How do I make my laptop shut down instead of running on battery after an AC power loss?
The idea is to have µTorrent run at night but not waste battery in the event of power loss (frequent around here). It would be great if the mechanism could be turned on and off easily as I only want the laptop to auto shutdown when I'm fast asleep – not every time the power goes out.
I tried making a new task using the Task Scheduler (in Administrative Tools), but couldn't figure out where the AC power loss event is to put it in the trigger.
-
Indrek about 12 yearsNice answer, creative use of the built-in power options. I took a screenshot and added it to your post.
-
Tamara Wijsman almost 12 yearsIt should also be noted that some programs will keep your system awake regardless, you need to ensure that the settings of your software are configured in so way that it does not prohibit sleep. It's very likely that if you run software that intends to do a long download, that there is some sort of protection against sleep included. Carefully googling about it or looking through the settings can help not being surprised by the above suggestions not working due to some override...
-
Simon Sheehan almost 12 yearsI would do something more like 97%... Sometimes your battery will dip to 99% just randomly discharging! (or so ive found)
-
frakman1 almost 4 yearsWill this work for a PC (non-laptop)? The idea is that another device connected to the UPS knows that it's time to shutdown and somehow signals this PC.