views:

817

answers:

1

What RegKey can you get the default browser application's path from?

Best way to get to it from C#/.NET?

+2  A: 

Here's the key you want:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\http\shell\open\command

And here's a quick registry tutorial for C#, if you need it.

Edit:

For per-user settings, use this key:

HKEY_CLASSES_ROOT\http\shell\open\command

(HKCR has both machine and user settings, user takes priority).

Note that this might not work on Vista. For more info, see here.

Jon B
But I assume you mean in HKEY_CURRENT_USER right?
tyndall
There's no matching key in HKCU. See my edit for more info.
Jon B
awesome. thanks.
tyndall
You almost certainly want the "HKEY_CLASSES_ROOT" one, NOT the HKEY_LOCAL_MACHINE one. HKEY_CLASSES_ROOT will always return the browser the user will be expecting.
mhenry1384