// SetEnableLongPaths.cs // // Enable Win32 Long Paths. // Lifts the legacy 260-character MAX_PATH limit for apps that opt in (requires admin). Requires an elevated (Administrator) prompt. // // Usage: dotnet new console -o SetEnableLongPaths, replace Program.cs with this // file, then dotnet run. using System; using Microsoft.Win32; using RegistryKey key = Registry.LocalMachine.CreateSubKey(@"SYSTEM\CurrentControlSet\Control\FileSystem"); key.SetValue("LongPathsEnabled", 1, RegistryValueKind.DWord); Console.WriteLine("Enable Win32 Long Paths applied.");