3

We have a GPO in place that sets IE 11 as the default browser on every startup. Instead of having to change the default browser to Firefox manually each time, I'd like to auto start a script that does it for me. I have Firefox Portable put in M:\Firefox\firefox.exe.

3
  • 6
    The GPO probably exists for a reason. It shouldn't be up to users to override it.
    – user931000
    Oct 23, 2018 at 9:05
  • This gets uglier and uglier from Windows 10 build to Windows 10 build. Right now the only way to script it are 3rd party programs and modifying the registry (I think).
    – Lenniey
    Oct 23, 2018 at 9:14
  • 1
    @user931000: the GPO might be set to initialize it on login, but if the GPO isn't designed to forbid changing it manually, they've implicitly accepted that it's ok if users operate with a different default. Of course contacting the IT department for clarification of what is allowed is never a bad idea. Mar 2, 2020 at 18:04

2 Answers 2

1

For a script, you need to change directly the registry.

I suggest that you go through the motions of setting Firefox Portable as your browser, then use regedit to Export the following keys :

  • HKEY_CLASSES_ROOT\http\shell\open\command
  • HKEY_CLASSES_ROOT\https\shell\open\command
  • HKEY_CLASSES_ROOT\.htm
  • HKEY_CLASSES_ROOT\.html

Consolidate them all into one .reg file and put it (or a link to it) on the desktop. In the future you should only need to double-click it and accept the UAC dialog to set Firefox as the handler.

1
  • 2
    This does not work correctly in my Windows 10 Enterprise version 16299.rs3_release_svc.180808-1748. Even after I have manually set my default browser and confirmed it's working, the values in the registry still reflect my company's GPO. Oct 31, 2019 at 19:28
1

hi use the following vb script it is working fine for me

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "%windir%\system32\control.exe /name Microsoft.DefaultPrograms /page pageDefaultProgram\pageAdvancedSettings?pszAppName=Firefox-308046B0AF4A39CB"
WScript.Sleep 1200
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"   
WshShell.SendKeys "{DOWN}"
WshShell.SendKeys "{DOWN}"
WshShell.SendKeys " "
WshShell.SendKeys "{DOWN}"
WshShell.SendKeys " "
WshShell.SendKeys "{DOWN}"
WshShell.SendKeys "{DOWN}"
WshShell.SendKeys "{DOWN}"
WshShell.SendKeys "{DOWN}"
WshShell.SendKeys "{DOWN}"
WshShell.SendKeys "{DOWN}"
WshShell.SendKeys " "
WshShell.SendKeys "{DOWN}"
WshShell.SendKeys " "
WshShell.SendKeys "{TAB}"
WshShell.SendKeys " "
WScript.Quit

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .