I am having the exact same issue as OP. I'm a tech professional. The issue is with Windows. I just 'reset' Windows fresh and the only thing I have installed is Irfanview and Chrome.
My above code is working only in Internet Explorer but it does not work in Chrome and Firefox. Please give me any solution of this so that i can.
If I choose anything other than Edge for my default browser, Windows asks me to 'check out' Edge, and below that there is a link for 'Switch Anyway.' Clicking on that link causes Windows to pause for 30 seconds or so, then the window closes. When I go back into default settings, the default browser is still Edge.So just because this change works for you doesn't mean it works for everyone. Otherwise, I don't think OP would have taken the time to ask the question. Ran into seemingly the same issue on my computer. When I'd select either Chrome or Firefox from the drop-down list in settings it would close the window for me. Figured out looking in the Event Viewer that SystemSettings.exe was crashing when I was trying to change the default.
Found this solution for me after some googling. Hope it helps!Found a solution,.
Goto SettingsApps & features then search for the app causing an issue ie edge and then click on Advanced Options. Select Reset and then after the reset has completed you can then successfully change the default browser again. This also works if you have issues changing the default apps for Video Player, Photo Viewer etc ie after doing a repair on the default Video Player or Photo Viewer you can then change the default app for these also.
When answering a question please:. Read the question carefully. Understand that English isn't everyone's first language so be lenient of badspelling and grammar. If a question is poorly phrased then either ask for clarification, ignore it, oredit the question and fix the problem. Insults are not welcome.
Don't tell someone to read the manual. Chances are they have and don't get it.Provide an answer or move on to the next question.Let's work to help developers, not make them feel stupid.