Search This Blog

Sunday, December 18, 2016

Reset Visual Studio "Look at these file types" value

private static void Main(string[] args)
{
    RegistryKey regKey = null;

    try
    {
        //HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\14.0\Find
        regKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\VisualStudio\14.0\Find"true);

        var filters = regKey.GetValueNames().Where(v => v.StartsWith("Filter"));
        foreach (var filter in filters)
        {
            regKey.SetValue(filter, string.Empty);
        }
    }
    catch (Exception ex)
    {
        Console.WriteLine("Registry clear for filter keys failed. {0}", ex.Message);
        return;
    }
}

1 comment:

  1. You can also just do it with this command:
    reg delete "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0\Find" /v Filter /f

    ReplyDelete