WiseCleaner Think Tank
Encounter difficult computer problems?
All about maintenance and optimization of your Windows System.
Sep 5, 2025
Laptop batteries don’t last forever, and if you often find yourself caught off guard when your device suddenly powers off, setting a custom low battery alert can help. Windows 11 already includes default low battery notifications, but customizing them ensures you receive alerts in a way that matches your preferences. This guide will walk you through how to set and personalize low battery alerts on Windows 11.
Windows has built-in options to trigger alerts at specific battery levels. Here’s how to configure them:
Low battery level – set your desired percentage for both On battery and Plugged in scenarios (e.g., 20%).
Low battery notification – set to On.
Click Apply and OK to enable your custom low battery alert.
Task Scheduler allows you to run a program, script, or message when the battery reaches a certain level. Here’s how:
Press Win + S, type Notepad, and launch the app.
1. Copy and paste the following code:
$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))
}
Note: Replace the number "30" with your desired battery percentage threshold.
2. Save the file with a .ps1 extension (e.g., BatteryAlert.ps1) by selecting All Files in the Save as type dropdown menu. Choose a location where you want to save.
1. Press Win + S and type Task Scheduler, then open the application.
2. In the right-hand Actions pane, click Create Task.
3. Under the General tab, provide a descriptive name like Low Battery Alert.
4. Check the box that says Run whether user is logged on or not for uninterrupted functionality.
1. Navigate to the Triggers tab, click New, and set Begin the task to On a schedule.
2. Enable Repeat task every and set it to 5 minutes (or your preferred interval).
Switch to the Actions tab, click New, and set:
Program/script: powershell.exe
Add arguments: -ExecutionPolicy Bypass -File "C:UsersYNZQ-02OneDriveDesktopBatteryAlert.ps1"
Replace the path with the actual location of your PowerShell script.
Click OK to create the task and enter your Windows password if prompted.
By setting custom low battery alerts, you can take better control over your device’s power management and avoid unpleasant surprises when working on important tasks.