🟣 C# / .NET 6+

Disable Storage Sense Low-Space Notifications (C#)

Silences low-disk-space notifications from Storage Sense. Applies the tweak via Microsoft.Win32.Registry.

By WindowsScripting.com · 591 B
SetDisableStorageSenseNotifications.cs
// SetDisableStorageSenseNotifications.cs
//
// Disable Storage Sense Low-Space Notifications.
// Silences low-disk-space notifications from Storage Sense.
//
// Usage: dotnet new console -o SetDisableStorageSenseNotifications, replace Program.cs with this
// file, then dotnet run.

using System;
using Microsoft.Win32;

using RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy");
key.SetValue("512", 0, RegistryValueKind.DWord);

Console.WriteLine("Disable Storage Sense Low-Space Notifications applied.");