Configuring Battery Alerts in Windows 11
If you’re looking to receive notifications when your laptop’s battery level drops below a certain percentage, Windows 11 provides several methods to achieve this.
Utilizing the Built-In Battery Alert Feature
One effective way to set up low battery notifications is by leveraging Windows 11’s built-in alert system. This option allows you to configure alerts to notify you when your battery level falls below a designated percentage.
With this built-in feature, users won’t receive a toast notification; rather, they will see an alert in the system tray indicating a low battery status.
Steps to Configure the Built-In Battery Alert:
-
Access Control Panel:
- Open Windows Search by pressing Windows + S.
- Type "Control Panel" in the search box and press Enter.
-
Navigate to Power Options:
- In the Control Panel, select "Hardware and Sound."
- Click on "Power Options."
- Find your active power plan and click on "Change Plan Settings."
-
Modify Advanced Power Settings:
- On the following page, click on "Change Advanced Power Settings."
- In the new window that appears, expand the "Battery" section located at the bottom.
-
Set Low Battery Level Notifications:
- Expand "Low Battery Level."
- For both the "On Battery" and "Plugged In" options, specify the percentage at which to receive alerts.
-
Enable Low Battery Notifications:
- Next, expand the "Low Battery Notification" section.
- Ensure that both "On Battery" and "Plugged In" are set to "On." If either is set to "Off," no alerts will be generated.
-
Save Your Changes:
- Click "Apply" and then "OK" to confirm your settings.
It’s essential to note that these configurations are specific to the power plan you are currently using. If you switch to a different power plan in the future, you’ll need to reapply these settings.
Creating a Custom Battery Alert with Task Scheduler
For users desiring a more user-friendly toast notification regarding low battery, a PowerShell script can be employed alongside Task Scheduler. This method will prompt you with a notification if your battery reaches a certain threshold.
Steps to Create a Custom Battery Alert:
-
Open Notepad:
- Access Windows Search by pressing Windows + S, type "Notepad," and open the application.
-
Enter the PowerShell Script:
- In Notepad, input the following code. Replace “30” with the desired battery percentage for the alert:
powershell
$Battery = Get-WmiObject -Class Win32_Battery
$Level = $Battery.EstimatedChargeRemaining
if ($Level -lt 30) {
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime]
$template = [Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent([Windows.UI.Notifications.ToastTemplateType]::ToastText01)
$toast = $template.GetElementsByTagName("text")[0]
$toast.AppendChild($template.CreateTextNode("Battery below 30%! Please plug in your charger."))
$notifier = [Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("Battery Alert")
$notifier.Show([Windows.UI.Notifications.ToastNotification]::new($template))
}
- In Notepad, input the following code. Replace “30” with the desired battery percentage for the alert:
-
Save the Script:
- Navigate to "File" and select "Save As."
- Choose the directory for saving your script, select "All Files" in the "Save as Type" dropdown, and name the file
BatteryAlert.ps1.
-
Access Task Scheduler:
- Open Windows Search again and type "Task Scheduler," then launch the application.
-
Create a New Task:
- In the right pane, click on "Create Task."
- Enter a name for your task, such as "Low Battery Level Alert."
- In the Security Options, ensure "Run Whether User Is Logged On or Not" is enabled.
-
Set Triggers:
- Go to the "Triggers" tab and click "New."
- Choose "On a Schedule" from the "Begin the Task" dropdown menu.
- Under Advanced Settings, enable "Repeat Task Every" and choose "5 Minutes" to check the battery status every five minutes.
-
Define Actions:
-
Navigate to the "Actions" tab and click "New."
-
In the "Program/Script" field, enter
powershell.exe. -
In the "Add Arguments (Optional)" section, type:
-ExecutionPolicy Bypass -File "C:\Users\Username\Desktop\BatteryAlert.ps1"
-
Replace the path to the script according to your save location.
-
-
Finalize Task Setup:
- Click "OK" on the Create Task window, and provide your account password when prompted.
Your PowerShell script will now run every five minutes as specified. Should the battery level fall below the designated percentage, a notification will appear.
In case you need to relocate the PowerShell script, remember to update its path in Task Scheduler to avoid alerts not being triggered.
Pausing or Removing Notifications
If you wish to cease notifications in the future, you can either disable or delete the task in Task Scheduler. Right-click the task to access options for pausing or deleting it.
Following these instructions, you can successfully set up low battery notifications tailored to your preferences on Windows 11, enhancing your laptop’s usability and ensuring you don’t run out of power unexpectedly.



