Search code examples
c#windowsregedit

If StartMenuInternet is not set, where else can I look for the default browser?


key = Registry.CurrentUser.OpenSubKey(@"Software\Clients\StartMenuInternet", false);
if (key == null)
{
    key = Registry.LocalMachine.OpenSubKey(@"Software\Clients\StartMenuInternet", false);
}

On a very few machines this is coming up blank. When regedit is probed, the key is found to be (value not found). What are my options?


Solution

  • I needed

    if (key == null || key.ValueCount == 0)
                    {
                        key = Registry.LocalMachine.OpenSubKey(@"Software\Clients\StartMenuInternet", false);
                    }