Yes, it is possible.
This example opens a command prompt and prints the URL.
To use notepad, you can write %url%
into a temporary file (using the .bat file), and invoke notepad with the temp file path after notepad.exe.
C:\choose_browser.bat:
@ECHO OFF
SET url=%1
ECHO URL = %url%
REM You can launch specific applications, passing the URL as an argument. For example:
REM start "" "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" %2 --single-argument %url%
run_this_once.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\BrowserChooserHTM]
@="Browser Chooser HTML Document"
"AppUserModelId"="BrowserChooser"
[HKEY_CLASSES_ROOT\BrowserChooserHTM\Application]
"AppUserModelId"="BrowserChooser"
"ApplicationIcon"="C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe,0"
"ApplicationName"="Browser Chooser"
"ApplicationCompany"="YAR"
"ApplicationDescription"="Browse the web"
[HKEY_CLASSES_ROOT\BrowserChooserHTM\DefaultIcon]
@="C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe,0"
[HKEY_CLASSES_ROOT\BrowserChooserHTM\shell]
[HKEY_CLASSES_ROOT\BrowserChooserHTM\shell\open]
[HKEY_CLASSES_ROOT\BrowserChooserHTM\shell\open\command]
@="\"C:\\choose_browser.bat\" %1"
[HKEY_CLASSES_ROOT\BrowserChooserHTM\shell\runas]
"ProgrammaticAccessOnly"=""
[HKEY_CLASSES_ROOT\BrowserChooserHTM\shell\runas\command]
@="\"C:\\choose_browser.bat\" --do-not-de-elevate %1"
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\http]
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice]
"ProgId"="BrowserChooserHTM"
"Hash"="8Rh/DSWNshc="
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\https]
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice]
"ProgId"="BrowserChooserHTM"
"Hash"="8Rh/DSWNshc="
[HKEY_CURRENT_USER\SOFTWARE\RegisteredApplications]
"BrowserChooser"="Software\\Clients\\StartMenuInternet\\BrowserChooser\\Capabilities"
[HKEY_CURRENT_USER\SOFTWARE\Clients\StartMenuInternet\BrowserChooser]
[HKEY_CURRENT_USER\SOFTWARE\Clients\StartMenuInternet\BrowserChooser\Capabilities]
[HKEY_CURRENT_USER\SOFTWARE\Clients\StartMenuInternet\BrowserChooser\Capabilities\URLAssociations]
"http"="BrowserChooserHTM"
"https"="BrowserChooserHTM"
Make sure you understand the contents of a .reg file before running it!
After running the regedit file, your default browser will be changed to 'Browser Chooser':
