This is a question asked many times - How to specify a browser to open a Internet Link .
Whether it be because we have a Web App that only works with Internet Explorer, or it works better with Mozilla Firefox, it launches a Java Application (and Chrome & Firefox just don't support Java anymore). Nonetheless, sometimes it's a pain. And, to make it worst, Users keep changing the default browser.
So, a simple solution is to create a new "protocol", create a link with said protocol in the URL and make Windows open it with the browser we want.
Open an text editor and paste the following code (this will create a URL to open only with Firefox):
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\mozilla-firefox] @="URL:Firefox Protocol" "URL Protocol"="" [HKEY_CLASSES_ROOT\mozilla-firefox\DefaultIcon] @="firefox.exe,1" [HKEY_CLASSES_ROOT\mozilla-firefox\shell] [HKEY_CLASSES_ROOT\mozilla-firefox\shell\open] [HKEY_CLASSES_ROOT\mozilla-firefox\shell\open\command] @="cmd /v /k \"set \"myvar=%1\" & set myvar=!myvar:mozilla-firefox:=! & start \"\" /B \"!ProgramFiles!\\Mozilla Firefox\\firefox.exe\" !myvar! & exit\""
Save the file where you want, and give it .reg extension. This will make it recognized to be a registry key.
Click on it for Windows to add it to the registry . The following warning appears:
WARNING: Only do this to keys you know and trust. Messing with the Windows Registry is a step into a catastrophe.
After adding the key to the registry, you can find it there, in HKEY_CLASSES_ROOT:
For it to work, just create a link in a web page
<a href="mozilla-firefox:https://www.google.com"> Google to Open in Firefox</a>
Open the file in any browser (not Firefox for sake of testing it)
Windows will present the following window, meaning it is recognizing the mozilla-firefox association.
Clicking "Open Windows Command Processor" it will open the Link in Mozilla Firefox.
You can easily create URLs for other browsers and even applications that you want to launch from a web page.
Here are files to open with Internet Explorer and Google Chrome:
What you need to pay attention is (using google-chrome):
- google-chrome is the "protocol". You can change it for whatever you like (change it file wide). What you put there is going to have to be what you put in the URL link in the webpage. ie: <a href="google-chrome:https://www.google.com">Google in Google Chrome</a>
- The browser location. The cmd variable is using ambient variables, so it points to Program Files or Program Files x86 in any language or location, if changed
There you have it. Now, specific programs will always open and work regardless of the default browser.
NOTE: Microsoft new browser Edge comes with its own protocol. You don't need any registry key, just use microsoft-edge:http://link to open it in Edge.
The following webpages helped me creating this: