// SetDarkMode.cs // // Enable Dark Mode. // Switches File Explorer and other system surfaces to dark mode. // // Usage: dotnet new console -o SetDarkMode, replace Program.cs with this // file, then dotnet run. using System; using Microsoft.Win32; using RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"); key.SetValue("AppsUseLightTheme", 0, RegistryValueKind.DWord); Console.WriteLine("Enable Dark Mode applied.");