Path Variable for Default Browser in Windows

Some files or folders in Windows have path variables (like %appdata%, %systemroot%, %userprofile%, etc). Is there anything similar to get the default browser?

For example, it could take the value C:\Program Files\Google\Chrome\Application\chrome.exe if Google Chrome is the default browser, C:\Program Files\Mozilla Firefox\firefox.exe if Firefox is the default browser, C:\Program Files\Internet Explorer\iexplore.exe if Internet Explorer is the default browser, etc and always have the same name no matter what.

2 Answers

You can use:

reg QUERY HKEY_CLASSES_ROOT\htmlfile\shell\open\command /ve

And you will get something like:

(Default)    REG_SZ    "C:\Program Files (x86)\Internet Explorer\iexplore.exe"

Then you can easily parse it.

5

To get the info about the default browser, you need to check the Windows registry.

You can find more info about this here :

Also you might won to check this to.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest