// SetDisableRecentDocsHistory.cs // // Disable Recent Documents History. // Stops Windows from tracking recently opened documents. // // Usage: dotnet new console -o SetDisableRecentDocsHistory, replace Program.cs with this // file, then dotnet run. using System; using Microsoft.Win32; using RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"); key.SetValue("NoRecentDocsHistory", 1, RegistryValueKind.DWord); Console.WriteLine("Disable Recent Documents History applied.");