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;
    }
}

No comments:

Post a Comment