0

First of all I would need to set the right registry entry before I continue with the code snippet to change my registry entries.

I have tried all I found on internet, and that's why I post here now.

All registry entries are not working which are referred on MSDN. Also changing those won't work:

HKEY_CLASSES_ROOT\http\shell\open\command

HKEY_CLASSES_ROOT\.htm

HKEY_CLASSES_ROOT\.html

HKEY_CLASSES_ROOT\http\shell\open\command

HKEY_CLASSES_ROOT\http\shell\open\ddeexec\Application

HKEY_CLASSES_ROOT\ftp\shell\open\command

HKEY_CLASSES_ROOT\ftp\shell\open\ddeexec\Application

HKEY_CLASSES_ROOT\gopher\shell\open\command

HKEY_CLASSES_ROOT\gopher\shell\open\ddeexec\Application

HKEY_CURRENT_USER\SOFTWARE\Clients\StartMenuInternet

My registry shouldn't know anything about my Mozilla, because I entered my own coded browser at every entry.

Don't know what to do...

After getting the right entries I would use a code snippet like that to add and change the entries:

        RegistryKey myKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\My Registry Key", true);

        myKey.SetValue("My String Value", "Test Value", RegistryValueKind.String);

        string myValue = (string)myKey.GetValue("My String Value");
bash.d
  • 13,029
  • 3
  • 29
  • 42
Florian Leitgeb
  • 15,657
  • 6
  • 31
  • 40
  • 'Won't work'? Well, *how*? You've changed them right...to what? Using **what code**? Now you've changed them **what happens**? – Arran Feb 20 '13 at 10:55
  • Tip: putting an @ symbol in front of a string literal allows you to NOT use escape characters. How is this relevant? It isn't ;) – Captain Kenpachi Feb 20 '13 at 11:09
  • I changed it to my Browser.exe and also deleted Firefox from all of these entries. Firefox is still starting as default Browser. But he asks me everytime if i want him as default browser, because he is not set.... Yes i know the @. This is only some example code for the work in the registry. @Arran Please read my whole post... – Florian Leitgeb Feb 20 '13 at 13:10

2 Answers2

1

This is a Little bit late, maybe too late but others might benefit from my answer. The settings changed in the code above complies to Windows XP and not windows Vista or 7. To set default browser in Win Vista or 7, use CURRENT_USER registry entries. Cheers!

Mik
  • 11
  • 2
0

You could use a sysinternals tool (i forgot the name) that takes a process and records all api and registry activity, and look how Google-Chrome does it.
Or you could directly look at the chromium sourcecode.

Or you could be lazy and just use google, wich would let you find this search result:
how do i change default browser using c# or batch file

Community
  • 1
  • 1
Stefan Steiger
  • 78,642
  • 66
  • 377
  • 442
  • This Post doesnt help anyway. As you can clearly see, the stackoverflow entry is not marked as answered. Maybe i will make the work and look at chromium code, thats a better hint than the stackoverflow post ^^ – Florian Leitgeb Feb 20 '13 at 13:12