// SetDisableTelemetry.cs // // Disable Windows Telemetry. // Lowers the diagnostic data Windows sends to Microsoft (requires admin). Requires an elevated (Administrator) prompt. // // Usage: dotnet new console -o SetDisableTelemetry, replace Program.cs with this // file, then dotnet run. using System; using Microsoft.Win32; using RegistryKey key = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Policies\Microsoft\Windows\DataCollection"); key.SetValue("AllowTelemetry", 0, RegistryValueKind.DWord); Console.WriteLine("Disable Windows Telemetry applied.");