🟣 C# / .NET 6+

Disable Windows Spotlight on Desktop (C#)

Turns off the Windows Spotlight rotating desktop background feature. Applies the tweak via Microsoft.Win32.Registry.

By WindowsScripting.com · 567 B
SetDisableWindowsSpotlight.cs
// SetDisableWindowsSpotlight.cs
//
// Disable Windows Spotlight on Desktop.
// Turns off the Windows Spotlight rotating desktop background feature.
//
// Usage: dotnet new console -o SetDisableWindowsSpotlight, replace Program.cs with this
// file, then dotnet run.

using System;
using Microsoft.Win32;

using RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Policies\Microsoft\Windows\CloudContent");
key.SetValue("DisableSpotlightCollectionOnDesktop", 1, RegistryValueKind.DWord);

Console.WriteLine("Disable Windows Spotlight on Desktop applied.");