I wrote this because I was unable to find any working tools on the Internet to correctly change the default browser association in Windows (such as if you want to use a portable edition of a browser).
The problem with all of the other tools on the Internet is that they do not correctly handle .URL files. Since .URL files are text files - they have to be passed to "HKEY_CLASSES_ROOT\InternetShortcut" where the URL gets parsed by shdocvw.dll and then passed to HKEY_CLASSES_ROOT\http. With other tools - the .URL files would open as text files in the browser instead of opening the actual URL itself. This script does it correctly.
Tested on WinXP SP3 x86 but should work on Vista and Win7 since the keys are documented as being the same. For documentation about the registry keys see here and see here2 and see here3.
Edited by robertcollier4, 01 February 2013 - 02:25 PM.