Category filter

Script to disable toast notification on Windows devices

Toast notifications, often called pop-up notifications, are short alert messages that show up in the lower-right corner of your computer screen. They will give you timely updates and information on your apps, system events, and other activities on your computer. Disabling toast notifications will prevent users from being interrupted by irrelevant notifications, reduce distraction, improve focus, and even improve the battery life of the device.

While you can disable toast notifications in Windows Settings, users can enable the option if they want to. By using the script below, IT Administrators can disable toast notifications, preventing users from making modifications. This can be achieved through Hexnode’s “Execute Custom Script” action.

Disclaimer:

The sample scripts provided below are adapted from third-party open-source sites.

Batch script to disable toast/pop-up notifications on Windows devices

The “reg add” command is used to add or modify a registry entry. “/f” is a parameter that forces the creation of the registry entry without asking for confirmation.

PowerShell script to disable toast/pop-up notifications on Windows devices

“-Force” in PowerShell commands allows overwriting or creating registry keys without confirmation.The “–ErrorAction” parameter is used to specify how PowerShell should handle errors. By providing “SilentlyContinue” as the value for “-ErrorAction”, PowerShell suppresses error messages, allowing the script to proceed to the next command without displaying any error messages.

Notes:

Restart the device for the script to take effect.

The scripts will change the registry value of ‘ToastEnabled’ from 1 to 0, thus disabling toast notification from being displayed on devices.

What happens at the device end?

With the execution of this script, the Notifications settings under Windows settings > System will be greyed out and the user will not be able to modify it.

The settings for toast notifications will be greyed out, preventing the user from making any changes to them.

Notes:

  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.

  • Sample Script Repository