All supported versions of Windows include a feature that helps you avoid the risk that you’ll lose data when your portable PC runs out of power.
Even in the latest Windows 10 versions, these settings are buried deep in the old-style Control Panel. Click System & Security > Power Options. To the right of the current power plan, click Change Plan Settings (Figure A), and then click Change Advanced Power Settings.
Figure A
At the bottom of the resulting dialog box, expand the Battery category, where you’ll find two groups of three settings (Figure B). By default, Windows pops up a notification when you reach the Low Battery level. You get a more urgent warning when you reach the Critical Battery level. Each setting also has an action associated with it. For the Low action, Do Nothing is one of four available options. When your system reaches the Critical Battery level, you must choose one of the other three options: Sleep, Hibernate, or Shut Down.
Figure B
Hibernate is the safest choice, saving the current state of the PC and shutting down so that you don’t lose any data.
I recommend setting the Low battery level to at least 10%, so you have time to finish what you’re doing. Don’t set the Critical Battery level lower than 4% unless you’re willing to risk running out of battery while your machine is in the process of hibernating.