SetDefaultBrowser – Set the Default Browser per command line or script

UPDATE 05.03.2024 – SetDefaultBrowser will not be maintained anymore. its functionality will be integrated into SetUserFTA.

UPDATE 20.02.2020 – Version 1.5 detects now Edge Side-by-side installations. How can i configure this

UPDATE 06.02.2020 – Version 1.4 adds support for Microsoft Edge Chromium

UPDATE 24.10.2018 – Version 1.3 is completely coded from scratch. New features: Supports ALL Browsers (any installed Browser, portable Browsers, App-V Browsers, AppData Browsers, etc.), start delay option added, full Unicode support, includes EULA.

UPDATE 16.12.2017 – Version 1.2 now supports Windows 8/8.1 and Server 2012/R2.

UPDATE 10.12.2017running Windows 1703 and newer, you can now use my SetUserFTA utility to change the default browser. Just make sure you set .htm. html, http and https properly. 

if you are into XenApp, RDS or VDI, then you probably know how difficult it is to configure the environment properly for the enduser nowadays. in my latest blog article, i showed you how to configure File Type Associations per User. based on this previous work i have created a utility that can do the same for the Default Browser.

the story behind is pretty much the same, but to set a Browser, additional Registry Keys are needed (they are protected with the hash just like the file types). the only difference is, that Microsoft also checks the path of the Browser – on certain Windows builds. for that reason i decided to create a separate tool to make it as simple as possible.

newer windows builds don’t check the path of the browser anymore and therefore the hash changed too – but i have updated my tool to support following operating systems:

  • Windows 10 x86/x64 All Builds
  • Server 2016 Build 1607
  • Server 2019 Build 1809
  • Windows 8 and 8.1
  • Server 2012 and 2012 R2

if you want to know more about the technical details, please read my previous blog post.

how to use

its really simple. just run SetDefaultBrowser.exe in the user context (there is a list of possible ways in my previous blog) with the the hive and browser of your choice. Since the version 1.3 there are more parameters and it might look complicated, but it gives you actually much more flexibility. Just run SetDefaultBrowser without parameters to get a list of all available browsers:

as you can see, i have a ton of Browsers on my system and using the following examples i can change the default Browser:

  • SetDefaultBrowser.exe HKLM Firefox-308046B0AF4A39CB
  • this will set the x64 Firefox as my default
  • SetDefaultBrowser HKCU “Google Chrome.HEYY3KJOYOAJOPVCHWOFAPMTPI”
  • this will set the Chrome that is only installed in my AppData as my default
  • SetDefaultBrowser.exe Edge delay=1000
  • this will set Edge as my default browser, but will wait 1 second until it executes. delay must be provided in milliseconds.
  • SetDefaultBrowser.exe HKLM IEXPLORE.EXE group=IE_Users
  • this will set IE as my default Browser, if i am member of the IE_Users group

i hope these examples explain the possibilities and parameters clearly. if a browser identifier contains a space, you must use quotes – for example “Google Chrome”. the same applies to group names (but you also can use Domain\Group or group@yourdomain.tld).

to maintain limited compatibility with the older versions of SetDefaultBrowser, i have added shortcuts to the most used Browsers

  • SetDefaultBrowser.exe chrome
  • this will set Chrome as my default Browser, when its available in HKLM
  • SetDefaultBrowser.exe ie delay=2000
  • this will set Internet Explorer as my default Browser but delays two seconds before
  • SetDefaultBrowser edge group=EdgeUsers
  • this will make Edge the default if the user is member of the EdgeUsers group

available shortcuts are: chrome, ie, iexplore, edge and edgelegacy. i had to skip Firefox, since you can have multiple Firefox installations (for example x64 and x86, like on the screenshot above) and using the hive and browser parameter, you can better specify which one you want to set as default.

SetDefaultBrowser will also find the browser when it is not installed at the default path.

the easiest way in an enterprise environment is to use the Group Policy Logon Script feature (you need loopback mode activated, when deploying to computers) – but there are many other ways (check the SetUserFTA blog for more ideas).

IMPORTANT: a portable Browser must be registered in the registry first to work with SetDefaultBrowser. You can learn how to do that in my blog post.

additional info

if you still see this screen after you used SetDefaultBrowser:

then try this registry key (needs an explorer.exe restart or just a re-login):

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer]
“NoNewAppAlert”=dword:00000001

this registry key also works with HKEY_CURRENT_USER!

or enable the GPO Do not show the ‘new application installed’ notification (Windows Components, File Explorer).

bugs? requests?

if you find a bug or have a special request, you can send me an email to bugs @ mydomain (the one in the browser address bar).

keep the project and this blog alive – please consider donating:

if you prefer cryptocurrencies or other payment methods, please contact me for details.

Thank you!

This version is only intended for private and non-comercial use!

For commercial licensing please use the link below.

We offer customized versions and source code options to integrate the SetDefaultBrowser functionality in your product. 

If you plan to use SetDefaultBrowser in a commercial or professional (non-private) environment, please request a quote over following link: https://setuserfta.com/request-a-quote/

download

download SetDefaultBrowser v1.5 here (free for personal use only). SHA265 hashes below.

.exe:21f1e8de0e8faf5eb5505cfef3cc0f14ee3eab7c3442ab0bb1d1a3e2e3988022
.zip:3b467ffdd7a065b94e97c54a06ca8c8dca642085afa40fbee1049af04a8de3ba

Version 1.0 – first public version
Version 1.0.1 – additional Firefox detection
Version 1.1 – now working on Windows 1703 and 1709, opera support added
Version 1.2 – support for Windows 8.x and Server 2012/R2 added
Version 1.3 – support for ALL Browsers, delay parameter, full Unicode, EULA
Version 1.4 – support for Microsoft Edge Chromium
Version 1.5 – allows Edge Side-by-side configurations 

SetDefaultBrowser will not be maintained anymore and its functionality integrated into SetUserFTA.

Bugs can be reported over the bug report page

222 Comments

  1. Dear Christoph,

    When I use the program together with a logon script Windows is resetting the default associations after a few seconds. Can you help me?

  2. great tool – one question though is there a way to force the browser and then not have Windows ask if I am sure I want to use my new default browser the first time I open it? (basically auto check the box)

    • my tool is supposed to do exactly that. if it doesnt work, the machine is in an inconsistent state. this can happen when you install additional browsers – ive seen that during my testing. if you use the *reset to the microsoft recommended defaults” button in the settings app, it should fix that and SetDefaultBrowser works as expected. which OS are you on and which browser are you trying to set as default?

    • i found out that this happens sometimes after you install a new browser, because HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts does not contain all needed registry keys. if you want to automate this, just select once your desired browser in the Microsoft popup dialog and then export the created associations (for example ChromeHTML_http, ChromeHTML_https, etc.)

  3. Seems to work after a new profile was created – thanks 🙂

    Just need to now get Defender and other AV solutions not delete any of your tools ! As they get auto removed without exceptions – looks like they all contain issues ?

  4. I had no luck in settings default browser to Chrome/IE using SetDefaultBrowser in GPO logonscript before I added a delay of 10 secs before running command.

  5. Great program, only issue I have is that when you set chrome as the default browser in windows 10 with this utility it also sets chrome as the default for .pdf files , is there an option to supress that ??

    • on which build is that? actually SetDefaultBrowser does not change anything related to PDF – it changes only .htm, .html, http and https handlers.

      but you could run “SetUserFTA .pdf AcroExch.Document.DC” after SetDefaultBrowser to make Acrobat Reader the default app for .pdf’s for example.

      • it’s windows 10 1607, doesn’t happen to all users either , this particular one logs into chrome with a google account.
        I ended up using the SetUSerFTA as you mentioned in the reply and that seems to work .

  6. Could you add Vivaldi to your list of supported browsers? It launches from C:\Program Files (x86)\Vivaldi\Application\vivaldi.exe and is a chrome based browser.

  7. Dear Christoph,
    Great tool!

    Can you verify that SetDefaultBrowser 1.2 is full compatible with Windows 10 1803 and Firefox ESR 60?

    • hey – sorry for the delay. i just tested it and it works for me on 1803 and Firefox ESR. do you encounter any problems with that combination?

  8. In the SetUserFTA post, you stated that if one wants to change the Mailto protocol on windows 10 1607 build to use this SetDefaultbrowser.exe. Is there a way to just set the mailto protocol to a non browser. example default mailto is set to Mail (Windows Mail), but if using outlook 2016. you had mentioned about creating a single exe that would just change MailTo. is that ready for prime time?

  9. I really love this little gem of a program!! Thank you very much for it!! One request though… When setting Chrome as the default browser, it also sets pdf files to be opened by Chrome too. Can this be changed to not change my default pdf associations?

    • i dont know why this happens, but other people reported it aswell. my app does not touch the .pdf extension at all, this must be caused by a previous configuration in the registry. but you can simply run SetUserFTA after the SetDefaultBrowser to assign the .pdf filetype to whatever you want – instead of chrome.

  10. Excellent article, Christoph. I’m interested on the MD5 reduction function. Is it a reused function that they are using here? Could you share more details about it?

    • its a Microsoft custom hash function. since its not a public code, i will not share more information about it – hope you understand that.

  11. Great program, thanks so much for cracking this one!

    Can you please explain how to use this to setup Citrix Metaframe Server FTA for client side browser redirection?

    We are hoping to get this to work for Server 2016 and have ServerFTAHTML be the default for http and https so that it defaults to the user’s local browser, but it keeps falling back to iexplore.exe within the user’s session by default after logging into a fresh session. We are currently using an XML file to populate the default file associations, but it isn’t working for all users so we were hoping to use your program instead to set the hash correctly.

    This is the hash and ProgId location for http and https:

    HKEY_USERS\\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice
    HKEY_USERS\\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice

    Any help you can provide would be greatly appreciated 🙂

      • Thanks for the quick response. Redirection from a http/https link clicked within a Citrix session to the user’s local browser. This used to work in Windows 2012 R2 using GPO and an XML file with default file associations, but isn’t working anymore for some users in Windows 2016.

          • Thanks for the great article, however this is already how we have implemented it. It appears that some users have somehow lost their ServerFTAHTML file type association in the following location and it’s breaking Host to Client browser redirection:

            HKEY_USERS\\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice\

            It’s setting ProgId to “IE.HTTP”, but it should be “ServerFTAHTML”

            Do you have a way that we can create a custom browser type so that we can use your SetDefaultBrowser application to set this value with the correct Hash so that it persists between sessions?

            All other values in the article you mentioned seem to persist, but this is the one that breaks and always reverts back to IE.HTTP or IE.HTTPS

          • that should be possible aswell yeah, but if this gets overwritten you most likely have a appassoc.xml in place. which profile solution are you using? and on which operating system are you working? Server 2016?

  12. If you could walk us through how to use your application to set this at login it would be much appreciated. We only started experiencing the issue once migrating to server 2016. We use the same XML config as the one used in the Citrix article you quoted. We use profile redirection and wipe profiles off the VDA on log out. So depending on what persists we would have to recreate it on login. It could be an issue with the XML, but we’ve set it up as instructed. It could also be related to the latest patches breaking the FTA as you mentioned on your blog?

    • ok… please try this: add these registry keys to your Server and then ServerFTA will appear when running SetDefaultBrowser. you can then set it as default with “SetDefaultBrowser HKLM ServerFTA”.

      Windows Registry Editor Version 5.00

      [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\ServerFTA]

      [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\ServerFTA\Capabilities]
      “ApplicationDescription”=”Citrix ServerFTA”
      “ApplicationIcon”=”C:\\Program Files (x86)\\Citrix\\system32\\iexplore.exe,0”
      “ApplicationName”=”ServerFTA”

      [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\ServerFTA\Capabilities\Startmenu]
      “StartMenuInternet”=”ServerFTA”

      [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\ServerFTA\Capabilities\FileAssociations]
      “.htm”=”ServerFTAHTML”
      “.html”=”ServerFTAHTML”

      [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\ServerFTA\Capabilities\URLAssociations]
      “http”=”ServerFTAHTML”
      “https”=”ServerFTAHTML”

      [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\ServerFTA\shell]

      [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\ServerFTA\shell\open]

      [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\ServerFTA\shell\open\command]
      @=”\”C:\\Program Files (x86)\\Citrix\\system32\\iexplore.exe\””

      • That did the trick!

        You’re a bloody legend 🙂

        The only change I made was the first line to this:

        [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\ServerFTA]
        @=”ServerFTA”

        Probably doesn’t actually make any difference to be honest, but after adding all the suggested registry keys and then running SetDefaultBrowser HKLM ServerFTA it fixed the stuck users and now the default XLA Citrix Server to Client redirect GPO is working as it should.

        Thank you so much for your help with this and being such an amazing knight in shining armour, battling the frustration that is Microsoft!

        • im glad it worked. important are FileAssociations and URLAssociations – now it will even redirect .htm and .html files to the client. if you dont want this, use SetUserFTA to change it back to the IE on citrix. cheers!

  13. Sorry, I am pretty much a newbie at this. Here is what I am needing: I would like to create a GPO that runs SetDefaultBrowser.exe upon logon for each user, and I would like the .exe to always default to setting Chrome. How can I accomplish this? I love the tool that you built and it is working flawlessly when done manually, but I need to push it out to a few hundred laptops and thin-clients. I know I need to make a logon script and put the .exe on a server/share that all users can access, but I am having trouble with making the script choose chrome without intervention and pointing it correctly. Thank you!

    • just run “SetDefaultBrowser.exe chrome” with a script or a policy. if it doesnt work, it might be a timing problem. then you can use “SetDefaultBrowser.exe chrome delay=2000” to run it two seconds later. check my blog from SetUserFTA under the section “how can i deploy this” for more ideas how to run this on multiple machines. there is also an example with screenshots for the gpo configuration.

  14. Hi Christoph,
    It seems not all users are created equal..
    We have noticed a very puzzling issue with the following path in the registry:

    HKEY_USERS\\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache

    When ServerFTAHTML is present for the user and server to client URL redirection is working, the following entries exist in the above location:

    Name: C:\Program Files (x86)\Citrix\system32\iexplore.exe.ApplicationCompany
    Data: Citrix Systems, Inc.
    Name: C:\Program Files (x86)\Citrix\system32\iexplore.exe.FriendlyAppName
    Data: Citrix Metaframe Server FTA

    When they are not present, ServerFTAHTML is replaced by IE.HTTP and IE.HTTPS respectively (at the following locations:

    HKEY_USERS\\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice
    HKEY_USERS\\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice

    Do you know why this might be?

    • hm.. no idea. but that key is not roamed with citrix UPM btw. and is part of the UsrClass.dat – if that makes any sense in your setup. what if you just create those registry keys with a GPO on every login? and what if you run SetDefaultBrowser with the delay option to overwrite IE.HTTP again?

  15. So it looks like it might have been a fluke when I got it working before. Whenever I run the SetDefaultBrowser now to ServerFTA, this is after login, manually run on the server they have landed on in the context of their user, it just gives the user the popup screen asking them to choose their default browser, which would be the same effect if I had deleted or altered the http/https entry under:

    HKEY_USERS\\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice

    So that would answer your question about running it with a delay, not working.

    I am still investigating the idea of incorporating the UsrClass.dat, but I don’t think that’s how we want it to work as we want to force the same browser for all users every time (their local browser with Server to Client redirect) and not give them the choice.

    It might be time to log a case with Citrix 🙁

    Do you know why your SetDefaultBrowser application would be failing to set the values under these keys correctly and thus prompting the user to choose a default browser after clicking on a hyperlink?

    HKEY_USERS\\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice
    HKEY_USERS\\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice

    • UsrClass.dat roaming is not supported with Citrix UPM. it will break the start menu if you have full desktops.

      but the message you are seeing is because Windows noticed that there is a new handler for http/https and therefore asks the user to select again. you can disable that “feature” with this policy: https://getadmx.com/?Category=Windows_10_2016&Policy=Microsoft.Policies.WindowsExplorer::NoNewAppAlert

      this message appears, even when the hash is correct.

      • Hi Christoph,

        Sorry for the delay in getting back to you.

        The key mentioned in that link is already “enabled” so it might be something else.
        HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer\NoNewAppAlert
        Value=1

        It’s been really busy at work lately, so I’ll try to keep troubleshooting this closer to Xmas when things start to quiet down. Thanks again for all your help 🙂

          • Hi Christoph, We already have the October 18, 2018 update (KB4462928) on our Windows 2016 VDA which includes the KB4051033 update. Interestingly if I remove the UserChoice Value Data for Hash and ProgId for http and https under HKEY_USERS\\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\

            then run the SetDefaultBrowser program as the user, the values are added back, but with a different Hash and as soon as an attempt is made by the user to launch a url using the browser from within the Citrix session, ALL entries under the UserChoice key are deleted for the link I launched eg. In my case http://google.com, however this redirected to https so the http key was untouched and only the https key was wiped and the user is prompted to choose a default browser. At which point they can choose Citrix MetaFrame HTML, which recreates the data, again with different hashes and the user is then able to redirect to their local browser. This however, does not persist between sessions and on login is set back to IE.HTTP and IE.HTTPS.

            I hope that makes sense?

          • yes – that makes sense. first of all – the hash will ALWAYS change when you use SetDefaultBrowser and also when you change the browser manually. this is by design. but when the entries get deleted from the UserChoice key, the hash was not correct and then you get the popup to select your default browser.

            this means, something in the setup from my registry key is not correct. it is really important, that this part is pointing to the correct location:

            [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\ServerFTA\shell\open\command]
            @=”\”C:\\Program Files (x86)\\Citrix\\system32\\iexplore.exe\””

            this must be the same path as you can find under HKEY_CLASSES_ROOT\ServerFTAHTML\shell\open\command

            if you want to roam these settings, you must use Citrix UPM or a similar profile solution. its important that you can roam the NTUSER.DAT file completely. you can not export/import these keys manually, because it will change the hash.

  16. Hi Christoph,

    Thank you for the quick response. There does appear to be minor discrepancy between the values in those two locations. Please see below:

    HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\ServerFTA\shell\open\command
    ”C:\Program Files (x86)\Citrix\system32\iexplore.exe”

    HKEY_CLASSES_ROOT\ServerFTAHTML\shell\open\command
    (Default) Value=”C:\Program Files (x86)\Citrix\system32\iexplore.exe” %1

    Please note the “%1” at the end of the second location. Would this make a difference?

    • that is ok. i noticed, when you copy paste the reg file from my blog, it does not set the path correctly, because of the ” characters that the blog formats in a different way.

      anyway – i have tested it now on a Server 2016 and it works as expected. when you run SetDefaultBrowser without any parameter, it should display the ServerFTA. is that working? it should look like this (showing the path):

      Installed browsers:
      ===================

      HKLM IEXPLORE.EXE
      name: Internet Explorer
      path: C:\Program Files\Internet Explorer\iexplore.exe

      HKLM ServerFTA
      name: ServerFTA
      path: “C:\Program Files (x86)\Citrix\system32\iexplore.exe”

  17. I am using this program to set IE as the default for an AD group on a server 2016 VM. It works perfectly as a login script deployed with group policy. However, I wanted to set chrome as the default for another AD group on the same server and now everyone who logs into the server is only getting chrome set as their default. I thought maybe the chrome AD group was wrong or somehow included everyone, but it doesn’t. Here is screenshot of how it looks in group policy: http://take.ms/TBC9E. Is this a bug or limitation with SetDefaultBrowser.exe? You can’t set 2 different browsers for different AD groups on the same server? thanks for the help.

    • this should work. could it be a timing issue? what if you change the order of the two commands? or use the delay parameter?

      • It’s not a timing issue. I tried adding the delay and the logon script sets IE as the default and then after the delay, it sets chrome as the default, for ALL users who enter the server. I’m using groups in my parameters but those are being ignored:

        SetDefaultBrowser.exe IE “LJ App IE Users”
        and
        SetDefaultBrowser.exe Chrome “LJ App Google Chrome”

        • yeah i know why this doesnt work. you have to supply the group name with the group= prefix. this has changed in the newest version of SetDefaultBrowser, since i added additional command line parameters.

          SetDefaultBrowser.exe IE group=”LJ App IE Users”
          SetDefaultBrowser.exe Chrome group=”LJ App Google Chrome”

          assuming you are using version 1.3

  18. Hi,

    When i want to run SetDefaultBrowser.exe it closes immediately without any warning or message. I tested this on 2 machines with same results.

    Win10 PRO 1607
    Win10 PRO 1809

    Disabling anti-virus give me same result.
    Does the app write any logging or something so i can find out what the issue may be? Or any tips?

    Thx!

    • you must run it from cmd or powershell. its a commandline utility. if there is an error in the processing of the commands, it will output them to the console.

    • did you relogin after setting the key? and whats the exact title of the message the dialog? is it asking “keep using this app” or something else?

          • ok, so this is not the same message. it does not say “keep using this app” – which means, the association is not set correctly. can you please use my other utility SetUserFTA and run a “SetUserFTA get”? it will list http and https and show there which progid is associated.

          • I have run the setuserFTA and this is what i Get.

            c:\>”D:\Notsaved\Rajamani\SetUserFTA\SetUserFTA.exe” get
            .bmp, AppX43hnxtbyyps62jhe9sqpdzxn1790zetc
            .gif, AppX43hnxtbyyps62jhe9sqpdzxn1790zetc
            .htm, ChromeHTML
            .html, ChromeHTML
            .jpeg, AppX43hnxtbyyps62jhe9sqpdzxn1790zetc
            .jpg, AppX43hnxtbyyps62jhe9sqpdzxn1790zetc
            .mkv, AppX6eg8h5sxqq90pv53845wmnbewywdqq5h
            .mov, AppX6eg8h5sxqq90pv53845wmnbewywdqq5h
            .mp4, AppX6eg8h5sxqq90pv53845wmnbewywdqq5h
            .pdf, AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723
            .png, AppX43hnxtbyyps62jhe9sqpdzxn1790zetc
            .wmv, AppX6eg8h5sxqq90pv53845wmnbewywdqq5h
            http, ChromeHTML
            https, ChromeHTML
            mailto, AppXydk58wgm44se4b399557yyyj1w7mbmvd

          • ok, this looks fine. chrome should be your default browser. can you set it manually as default (using the settings app) and run again SetUserFTA get? thanks

          • Now i have set Chrome as default manually from settings and here is the setuserfta

            .bmp, AppX43hnxtbyyps62jhe9sqpdzxn1790zetc
            .gif, AppX43hnxtbyyps62jhe9sqpdzxn1790zetc
            .htm, ChromeHTML
            .html, ChromeHTML
            .jpeg, AppX43hnxtbyyps62jhe9sqpdzxn1790zetc
            .jpg, AppX43hnxtbyyps62jhe9sqpdzxn1790zetc
            .mkv, AppX6eg8h5sxqq90pv53845wmnbewywdqq5h
            .mov, AppX6eg8h5sxqq90pv53845wmnbewywdqq5h
            .mp4, AppX6eg8h5sxqq90pv53845wmnbewywdqq5h
            .pdf, AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723
            .png, AppX43hnxtbyyps62jhe9sqpdzxn1790zetc
            .wmv, AppX6eg8h5sxqq90pv53845wmnbewywdqq5h
            http, ChromeHTML
            https, ChromeHTML
            mailto, AppXydk58wgm44se4b399557yyyj1w7mbmvd

          • this looks exactly the same. i cant see any error. can you change the browser to IE or Edge with SetDefaultBrowser? does that work correctly?

  19. I am using this exe as part of the MDT to upgrade Win 7 64-bit to Win 10 64-bit in-place upgrade. This task is part of the Post-Processing and below is the command used.
    SetDefaultBrowser.exe HKLM IEXPLORE.EXE

    The error I see is
    Unknown error (Error: 74E1BCE8; Source: Unknown)

    Appreciate any help with this error. The execution aborts because of this error.

    • this is not an error of my tool – but you can try to redirect the output of SetDefaultBrowser to a txt file – if there was an error it will log it.

      you can do it like this “SetDefaultBrowser ie >sdb.log”

      there is a shortcut with IE, since its always only available under HKLM you must not supply it explicitly. ie or iexplore works.

  20. I am trying the application on a Windows 2019 RDS Farm. When starting the application I get a pop-up with the question to look for an App in the Microsoft Store, additionally the message tells me I have to install an app for this task.

    What app is is? I would not like the end-users to receive this message.

    • i dont really understand. if you get this message, you are trying to open a file, which doesnt have a program assigned. which filetype are you opening?

  21. Hello, im using your SetuserFTA program since a while with success.
    Now i want to publish an url-selector for some internal links whish should be opnend with a self written programm. My programm is simmilar to “https://github.com/DanTup/BrowserSelector” with some different functions. The Problem is when i register my Program or even the Dantup Browserselector (example setuserfta HTTP DanTup.BrowserSelectorURL) the userchoice hash that is generated differs from the hash calculated by the “default Programs” under conrol panel and the association fails. I register the same reg keys as dantup does. So I tried to use “SetDefaultBrowser” but its missing the reg keys under “HKLM\Software\Clients” so i tried to merge them from “HKLM\software\DanTup.BrowserSelector\Capabilities\” and “HKCR\DanTup.BrowserSelectorURL\” and added same dummy filetypeacociations because your program demands it but still the hash is different. Do i miss some regkeys or can u figure out where the problem comes from. Thx in advance Niklas

      • what i forgot to mention is that its a citrix terminal server with server with windows 2012 R2 , the hash is always the same when i use windows or ur programm, its always 2 different keys which stay the same each. can i use the protable guide for prgrams that i want to make available for all users?

        • on 2012 R2 the hash will be the same. this behaviour only changed with Server 2016 or Windows 10 and newer. you can not set http or https with SetUserFTA on Server 2012 R2. you must use SetDefaultBrowser. you can use my guide for the portable browser and instead of HKEY_CURRENT_USER you can use HKEY_LOCAL_MACHINE and then it will be available for all users (not portable therefore). which command did you run with SetUserFTA? it should give an error for http and https on Server 2012 R2.

          • ok i guess i figured it out i read ur portable article and saw that there is no %1 after \Clients\StartMenuInternet\..Browsername..\shell\open @path Now it seems to work, iwill try with my program to and give feedback. It would be nice if u could add a parameter to ignore Fileasscosiations in my case i dont need or even dont want them to be asscociated with that program.

          • the thing is, Microsoft sets the filetypes with the “default program” app too and i wanted to make it act the same way when setting the default browser. on Server 2012 R2 the http/https protocols are protected harder than on Server 2016 and it would be quite complicated to implement that in SetUserFTA. but on Windows 10 or Server 2016 and newer you can use SetUserFTA to set only http and https without the filetypes – this is a limitation on Server 2012. in your case you could use SetUserFTA after SetDefaultBrowser to reassign the filetypes to a different application.

  22. Hi – I’m trying to use setdefaultbrowser on our workstations, but get the Win10 nag stating: “How do you want to open this file?” and “Keep using this app”. What I’m hoping for is to be able to set the default browser to IE with NO later Microsoft nags, period. I’m running it like this: “setdefaultbrowser hklm iexplore.exe” and also just “setdefaultbrowser ie” with admin rights. SetDefaultBrowser doesn’t report any errors. This is the latest version 1.3.0.0.

    Regarding our environment, we’re running Win10 Enterprise, ver 1709, build 16299.904 & build 16299.1087 and all workstations are joined to a domain. Any help would be greatly appreciated.

    • Also want to add that I also have gotten a similar nag “How do you want to open this file?” but with the subtitle “Featured in Windows 10”. This came after first getting the similar nag: “Keep using this app” after I had run SetDefaultBrowser again under the local user (non-admin) account.

      • im not 100% sure but i think you can disable that with the “Turn off Microsoft consumer experiences” GPO or this registry key

        HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent
        DisableWindowsConsumerFeatures DWORD 1

    • this dialog appears when you install an additional browser or app that handles http/https. you can disable this behaviour with this registry key

      [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer]
      “NoNewAppAlert”=dword:00000001

  23. hello i have a question so right now i tried running setdefaultbrowser.exe using GPO logon script and the startup folder but it doesnt work and the exe itself doesnt run it just saw a second of the cmd window then closes ik theres something i need to do and its probably stupid but can u help me

    • its a command line program. you must supply the correct parameters like “SetDefaultBrowser chrome” for example. if it doesnt work with GPO, then you might have to add the a “delay=2000” to make it run later during the logon process. hope this helps.

  24. Hi Christoph,

    Your application works *perfectly* on Windows 7, 8.1 and 10 when run as a logged-in user, but fails if I try to run it using “NT Authority\System” (which is what my RMM software uses to execute scripts and deployment packages).

    Can you think of any reason why it might not execute properly when run as “NT Authority\System”?

    Thanks in advance!

    • it runs also as SYSTEM, but it will write everything in the profile of SYSTEM and that is not what you want. you cannot set associations with a service account or SYSTEM. my tools must be run in the current user context. this is because it uses the SID of the user that is logged on. that is by design from Microsoft. you can not use it to apply associations to a machine. if you want that, you can use the official solution from Microsoft using this method: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/export-or-import-default-application-associations

      • Hi Christoph,

        Thank you very much for your quick reply, this is very helpful!

        Toward the end of my testing yesterday, I came across another post (https://qtechbabble.wordpress.com/2016/08/15/running-command-prompt-as-nt-authoritysystem-to-test-sccm-applications/) that explains how to run CMD as “NT Authority\System” for testing purposes.

        I used that to observe the behavior of the application under that context and could see that it was executing (i.e. not a permission issue) and had concluded by then that I needed to figure out how to run it against an actual user.

        I did find a work around I’d like to share in case anyone else runs into this. I’m using Datto RMM, and while it runs “quick jobs” (i.e. on demand) as “NT Authority\System”, scheduled jobs can be configured to run only when someone is logged in.

        Once I created a scheduled job and ran it against a logged in user, it worked!

        Thanks again!

  25. I’ve just found your utility and I must say it looks amazing. I’m running some tests now and I’m looking to find out if there is a way to specify to use the 32Bit version of IE under the x86 folder. I have an app that requires IE 32Bit (frustrating).

    Thanks!

  26. Hi there, great tool;
    We would also like to use it withe the new Edge Chromium; Except this does not seem to work:
    error: browser not found, please verify your input

    • im am aware of this isse and will publish an update in two weeks, since i am on vacation right now without my development environment. thanks for your patience!

      • Hi Christoph! It looks like it a parsing error of the token “Microsoft Edge”. If I rename the key “Microsoft Edge” located at “HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet” to something else like “Microsoft Edge X” and then call “SetDefaultBrowser.exe HKLM “Microsoft Edge X” it works perfectly.

        • yes, i know the cause of the issue, but i cannot release an update atm, because im on vacation without my development environment.

          your workaround will do fine for SetDefaultBrowser, but it might cause issues when updating Edge Chromium in the future :-/

          • Hi Christoph, This registry modification was only for testing and demonstrate the parsing error – I would not change the registry in any way ! Otherwise, your proposed fix as of version 1.4 works for the new Edge Chromium but support for Edge Legacy in the event of a side by side installation prevent Edge Legacy from being set as the default browser. Any hint? You can reach me by email. Thank you for your great work

          • Microsoft does remove Legacy Edge as soon you install the Edge Chromium from the list of available browsers, thats why i made SetDefaultBrowser like this too. If you are on 1703 or higher, you can use SetUserFTA to have both. I dont think there is really a need of that possibility?

      • Hi Christoph, I am trying to set the Chromium Edge as a standard browser with setdefaultBrowser-EDGE Version.
        Nevertheless the error comes: could not find edge.
        I use the current stable version Microsoft Edge 79.0.309.71

  27. Sadly the version 1.4 does not work correctly on Windows Server 2012 R2 Terminalserver with MSEdge Chromium. I use the command line SetDefaultBrowser.exe edge
    I can see, that under the key HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice the ProgId is set to MSEdgeHTM and a Hash is generated. But when i try start http://www.google.de a dialog box appears. When i choose the Edge entry, the Hash is rewritten.
    It is working with SetDefaultBrowser.exe iexplore
    Do you have any idea? Many thanks for your help and your work!

    • yes. you have to set this registry key to avoid this popup:

      [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer]
      “NoNewAppAlert”=dword:00000001

      works also with HKEY_CURRENT_USER and there is a GPO for that setting aswell: Do not show the ‘new application installed’ notification.

      • I’m also encountering this issue on Server 2012 and already tried adding the “NoNewAppAlert” key. This didn’t make a difference, it’s not giving a popup for a new app but it’s giving the “How do you want to open this file?” popup. It works fine with setting Chrome for example, only gives issues with Edge. Also, just as Bonnix stated, when the “How do you want to open this file” popup appears and I select Edge it generates a different hash then was set by SetDefaultBrowser.exe. When I use “SetUserFTA.exe get” it also does output MSEdgeHTM as the FTA for http and https. Am I missing something? Would be greatly appreciated if you could help out, thanks in advance!

  28. I just came here to say thank you for doing this. I have multiple Windows Server where non-admin users login every day and i needed a way to change the default browser for them via de HKCU context and this worked like a charm.

    • Yeah – ESET decided to rate my tool as potential unsafe. Sadly there is nothing that i can do about that, but you can whitelist it from your side. I have got reports from other users where they whitelisted the SHA-1 of the binary in ESET.

      • Thanks, have whitelisted it & submitted a false-positive sample to ESET.

        Is there any chance of getting a shortcut for Firefox? Othewise I have to specify ‘HKLM Firefox-308046B0AF4A39CB’ which I presume will change with versions.
        Thanks,
        Matt

        • Thanks 🙂

          Since there are multiple Firefox versions/editions, i cannot add a shortcut for it. You can have x64 and x32 and portable all on the same machine and there is no way how to know which one you want to set with the shortcut.

          The progid does not change with updates. It only changes for different bitness or distributions.

  29. Hi!
    I tried to run the SetDeafultBrowser.exe with Task Scheduler, to set Firefox as the default browser. I created a new task and set it to run at logon. When I manually run the task, it does the job just fine, but when I restart the computer, the task runs (I can see in the history of the task that it was started and completed), however, the default browser doesn’t change to Firefox. Any idea what may be wrong?

  30. Great tool. Please could you confirm the reason why VirusTotal comes up with some hits. Especially from ESET. What could be causing this.

    • ESET has blacklisted my tool as potential unsafe program. I cannot really do something about that and I dont know why they did that. The other reports from virustotal look like an adware did use my tool to overwrite the default browser and for that reason it gets flagged :-/

      • Ok. Thanks. What language and compiler was used for the utility? Was tcc used to compile it like the previous version of setuserFTA? Could this have contributed to the hits?

        • its compiled in gcc. tcc caused too many false positives. i might try to use a different compiler to see if it makes any difference for virustotal

    • i know that this is possible using Citrix published app, but sadly I dont have any idea how to do that with Microsoft RemoteApp

  31. Hi, this is a great tool, thank you. I am able to successfully set the default browser from in our deployments from IE to Chrome in v20H2 via the runonce regkey, but we are looking to only set it one time, after that empower the user(s) to decide going forward

    After running the tool to set Chrome as the default browser, if the user changes it to Firefox, for example, after a logoff or reboot, Chrome is set to the default again. is there a way to not make the change persistent?

    • if it is not persistent, then something else overwrites it. do you have maybe a gpo with the file association xml in place? how do you set the RunOnce key? it deletes itself after execution and you have to make sure that it doesnt get set again then.

  32. Hi Christoph, Setdefaultbrowser is a great tool ! Do you think it was possible to add the option to know what is the actual default web browser ? In addition to the list of installed browser, it would be practical to have this information too. Kind regards.

    • you can use my other tool SetUserFTA with “get” as parameter to find that information. The thing is – the default browser is not a single value. You can have a browser for http and another for https. same for .html and .htm files. Microsoft and my tool sets all four values to the same browser, but technically you could have a mixed setting and this is therefore not easy to detect. with “SetUserFTA get” you will see which ProgID is set for the protocols and files.

    • for me f-secure is green – but ESET flags my tool. they rated it as potential unwanted, not as a virus. sadly i cannot do anything against that, but its a false-positive

  33. Hello Chris, I know you have instructions on how to use the Setdefaultbrowser, but I am a little confused as to how to get Edge to be the default. I am running a Citrix Xenapp environment with Non-persistent servers. We have edge installed. Could you please provide some sort of step by step to get this working, will really appreciate it.

  34. I was able to get it to work finally. The issue was a little stupidity on my part, the actual executable was not in the Login folder of the Loginscript, it was in the Scripts folder, so the login script was failing. I am not sure how I got the choose the browser list option.

    In any event after I successfully copied the executable in the Login folder of the script in use, it automatically defaulted. I was clicking the link in an email from Published Outlook on the Xenapp.

  35. In both x32Win10ProV21H1 and x64Win10ProV21H1, double clicking the exe, merely triggers a VERY brief display of what may be a Command Prompt window, it’s too brief to be able to identify it. What could be going wrong ? More importantly, how can I get it to give a useful program window ?

  36. I can’t set AVG Secure Browser as a default browser. It keeps saying, “Error: Browser not found, please verify your input.”

      • Oh wow! It’s really worked. Why didn’t you tell us to use quotation marks? Maybe I am missed something. I wasted my the whole day for this. Thank you anyway. My operating system is corrupted. I can’t set the default browser, I can’t update the Windows, I can’t use DISM properly… In fact, I have to install Windows again, but I hate it. Thank you very much.

        Sincerely yours, GAMBOT.

        • its written on the blog: if a browser identifier contains a space, you must use quotes – for example “Google Chrome”

          you can do an inplace installation of windows in your case. just re-install windows on top of the current installation and it will keep all settings and apps.

          • Then I didn’t notice it. Anyway. By the way, I can’t do in-place installation. It returns me with an error so custom install needed but U don’t want it at the moment. I am gon’ try to go ahead with this corrupted Windows.

  37. Is SETDEFAULTBROWSER incompatible with TSHIDE (https://www.ctrl-alt-del.com.au/files/TSHide.txt)?
    When I use SETDEFAULTBROWSER in a batch file under Citrix Xenapp 1912 to publish it together with an application launch it works. Disadvantage: The customer see the content of the batch file. Publishing batch file with TSHIDE breaks SETDEFAULTBROWSER.

    • is tshide running in a different user context like SYSTEM for example? it must run as the current user, else it will not work.

  38. I’ve been using this program for quite a while with no problems. But just recently (maybe about a month ago, I’m not really certain), the “How do you want to open this?” screen sometimes appears when I click on a link in an e-mail or do something in a program that should cause it to open a webpage in Firefox. I have verified that “NoNewAppAlert” = 1 in both HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer and HKEY_CURRENT_USER\… as well as several other registry keys suggested on other websites.

    Since this started happening just recently, I suspect Micro$$$oft probably broke something with last month’s Windows Update.

    • i’m not aware of any change and there are not other users reporting that issue. is the dialog that you get containing “keep using this app” or does it just ask to select an application? which browser is causing the issue?

  39. Hello Christoph!

    We’ve been using your SetDefaultBrowser.exe for a few years now and it seems like it’s not functioning as intended anymore for us.

    To see if I had to edit the script I tried running it from the user context however it no longer returns any screen like in your example above on the webpage.

    I tried this on the following OS/versions:
    – Windows Server 2016 version 1607 (no antivirus installed)
    – Windows Server 2012 R2 Version 6.3 (build 9600) (sentinel one installed, no detections)
    – Windows 11 Version 21H2 (sentinel one installed, no detections)
    No appcrashes or seemingly any references to anything going wrong regarding this in the event log.

    Above was tried with SetDefaultBrowser.exe version 1.4 and 1.5

    Would you have any tips for us as to what to try next?
    This program is/was a godsent for us and would love to keep using it.

    Thanks in advance for your time!

    • i have just tried it on a fully patched server 2019 and it works normally. what exactly happens when you run it in cmd without any parameter? did you verify the SHA256 after downloading?

      • Thank you for your quick reply!

        I used CertUtil to verify the hash was identical to the one in the file, which is the case.

        Having said that, the matter can be considered solved as the problem was never your program by the looks of it:

        I still can’t get the CMD screen to work (that shows which browsers you have installed), I’m at a loss for this one, however:

        This incorrectly led me to believe the program itself wasn’t functioning. (I just briefly see CMD screen popping up when running it in the user context)

        When creating several new users to test this as a genuine first log-in experience it sets the default browser just fine, I however thought it didn’t because:

        The GPO: Do not show the ‘new application installed’ notification – is not doing what it’s supposed to, this is however our own problem to solve 😉

        Thanks again for your time and efforts.

        • you must run a cmd first and from there start SetDefaultBrowser. if you just double click it, it will show the list of browsers very quickly but close then. its a command line utility, therefore you must run it on a command line 🙂

          • If you could see the look on my face when I read that.
            I need a holiday… 😀

            Thanks for the clarification! It works beautifully. 🙂

  40. Help please,

    Trying to run as batch file. Only works for IE.

    @echo off
    SetDefaultBrowser HKLM msedge.exe
    cscript MessageBox.vbs “Default Browser set to Microsoft Edge”

    returns “error: browser not found, please verify your input”

    swapping msedge.exe with iexplore.exe and it works.

    Any ideas? Thank you

  41. Hello

    I’m trying to use this tool but it gets recognized as “potentialy dangerous software” and deleted by our antivirus “Eset Endpoint Antivirus” 🙁

    • sadly there is nothing that i can do about that. you can check my tool on virustotal.com to see that this is a false positive and configure an exception in your antivirus for it.

      • Ok. I have just discovered that your other tool for setting standard program for file extensions works without any flaws even to change the browser.

  42. hello, can you use variable when running the command? for ex: $browser = HKLM Microsoft Edge , then run SetDefaultBrowser.exe “$browser”
    Tried it multiple times to no avail.
    btw, this tool is awesome.

    • that should work… but im not sure if you are using cmd or powershell?
      for cmd something like this should work
      set browser=”HKLM Microsoft Edge”
      SetDefaultBrowser.exe %browser%

      in powershell you probably have to use start-process

  43. Thanks for creating this excellent tool. Would it be a lot of work to update it so it supports Brave Browser?

    Thanks

    • it supports all browsers that register themself correctly on the machine. i have Brave installed too and it shows up in the list. you can set it as default with

      SetDefaultBrowser.exe HKLM Brave

  44. Many thanks to the author for this tool. I have whitelisted it in my antivirus and hope others do not fear doing the same. The antivirus companies don’t listen very well, it seems, even after it was reported as a false positive two years ago. But thank you again to the author.

    • it seems that some malware has abused my tool and thats why it got blacklisted with some antivirus. sadly i cannot do anything against that.

  45. can you pls let me know what and how you are changing default browser settings which registry actually you are hitting ? , as i can’t use this exe it’s blocking by antivirus in environment

    • i have described the process in my blogpost about SetUserFTA – SetDefaultBrowser is pretty much the same, but handles only browsers instead of all filetypes. sadly you cannot just set a simple registry key anymore, therefore i made these tools. if antivirus does not allow my tools, you can use the official microsoft solution – which is also described in the SetUserFTA blogpost.

  46. Hi Christoph,

    1. greetings from Vienna, Austria.

    2. I really like your litte program; it helps me change the default browser from Chrome to Firefox at every login.

    3. Now, I would like to change “Open PowerShell Window here” to “Open Command Prompt here” in the Folder context menu (my company blocks both PowerShell and RegEdit).

    Thanks, Christian

5 Trackbacks / Pingbacks

  1. EUC Weekly Digest – November 11, 2017 – Carl Stalhood
  2. Dateiendungen automatisiert unter Windows 10 mit den gewünschten Applikationen verknüpfen ← Gunnar Haslinger
  3. SetDefaultBrowser – Set the Default Browser per command line or script – Bienvenue sur la KBelliot ;)
  4. Default Browser win10 with UEM – Julian Erber Tech BLOG
  5. The Enterprise ready browser Microsoft Edge for business – How to configure for Edge | Marius Sandbu

Comments are closed.