• Tutorial: How to set up any batch script as your Windows default web browser

    From Marion@marion@facts.com to alt.comp.software.firefox,alt.msdos.batch,alt.privacy on Tue Aug 19 15:33:05 2025
    From Newsgroup: alt.msdos.batch

    Tutorial:
    How to set up any batch script as your Windows default web browser
    [Tested only once. By me. Today. On Windows 10. For privacy.]

    Today I set up a bogus default web browser in Windows 10 that I document
    below so that others who are annoyed by "things popping up" can annul them.

    Normally I'd want to set up the Mozilla-based Tor web browser (TBB)
    as the browser default since it doesn't connect automatically by default.

    But apparently Tor isn't registered as a web browser in Windows.
    We could register Tor as a browser - but this may be a better way.

    1. Create a batch file that does whatever you want
    2. Convert that batch file to a Windows executable
    3. Define that executable as a web browser in the registry
    4. Set that "web browser" as your default Windows browser

    I had never done this before, so I write this up for you,
    so that you too can define anything you want as your default
    web browser in Windows.

    My batch file simply appends to a text log & edits it for viewing:
    @echo off
    REM C:\path\to\dummybrowser.bat 20250819 revision 1.0
    set LOGFILE=C:\path\to\dummybrowser.log
    echo [%date% %time%] Attempted launch: %* >> %LOGFILE%
    start "" "C:\path\to\gvim.exe" "%LOGFILE%"
    exit

    Since Windows won't set the default web browser to a batch
    file, let's convert that dummybrowser.bat to dummybrowser.exe
    using any of a number of batch-to-executable converters.
    <https://github.com/l-urk/Bat-To-Exe-Converter-64-Bit/releases>
    <https://github.com/l-urk/Bat-To-Exe-Converter-64-Bit/releases/download/3.2/Bat_To_Exe_Converter_x64.exe>
    1. Open that "Bat To Exe Converter v3.2" executable.
    2. Select your .bat file using the folder icon.
    3. At the right, in Options, there is "Exe-Format" with these choices
    32-bit | Console (Visible)
    32-bit | Windows (Invisible)
    64-bit | Console (Visible)
    64-bit | Windows (Invisible) <== Use this to compile a batch file
    as a 64-bit GUI-style exe that runs silently with no console window.
    4. Click the "Convert" button to convert batch to exe.
    (Optional) Add an icon or version info.
    5. Choose your output path in the "Save as" field.
    C:\path\to\dummybrowser.exe

    But you still can't set the dummy browser yet as it's not registered.
    Win+I > Apps > Default apps > Web browser >
    That gives you the following four choices, none of which work yet.
    Choose default apps by file type
    Choose default apps by protocol
    Set defaults by app
    Recommended browser settings

    You first need to register your exe as a browser in the registry:
    HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet

    To do that, right-click "merge" this registry file:
    gvim C:\path\to\register_dummy_browser.reg

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\DummyBrowser]
    @="Dummy Browser"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\DummyBrowser\Capabilities]
    "ApplicationName"="Dummy Browser"
    "ApplicationDescription"="A privacy-preserving dummy browser"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\DummyBrowser\Capabilities\FileAssociations]
    ".htm"="DummyBrowserHTML"
    ".html"="DummyBrowserHTML"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\DummyBrowser\Capabilities\URLAssociations]
    "http"="DummyBrowserHTML"
    "https"="DummyBrowserHTML"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\DummyBrowserHTML\shell\open\command]
    @="\"C:\\path\\to\\dummybrowser.exe\" \"%1\""

    [HKEY_LOCAL_MACHINE\SOFTWARE\RegisteredApplications]
    "Dummy Browser"="Software\\Clients\\StartMenuInternet\\DummyBrowser\\Capabilities"

    Now you can select the dummy browser as your default web browser.
    Win+I > Apps > Default apps > Web browser > dummybrowser.exe

    Voila!

    If any rogue process brings up the default browser, it is logged.
    And nothing else happens. How kewl is that!

    Please improve if you also need privacy in web browser sessions.

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Marion@marion@facts.com to alt.comp.software.firefox,alt.msdos.batch,alt.privacy on Tue Aug 19 15:46:53 2025
    From Newsgroup: alt.msdos.batch

    On Tue, 19 Aug 2025 15:33:05 -0000 (UTC), Marion wrote :


    Please improve if you also need privacy in web browser sessions.

    For example, most people would likely want the privacy-oriented
    Mozilla-based Tor browser as the default trap for rogue URLs.

    But the Mozilla-based Tor Browser is designed to be portable
    and privacy-preserving. Some versions of Tor can register as
    the default browser, but others won't register as a default.

    Hence, the Mozilla-based Tor browser doesn't usually appear
    in the list of default apps because it doesn't create registry
    entries that Windows uses to identify web browsers.

    This is intentional to avoid leaving traces on the system.
    However, we can slightly modify our batch file to invoke Tor.

    @echo off
    REM C:\path\to\torbrowser_launcher.bat 20250819 revision 1.1
    REM This launches the Tor Browser with the URL passed as argument
    set TOR_EXE="C:\path\to\Tor Browser\Browser\firefox.exe"
    start "" %TOR_EXE% %*
    exit

    The registry file can be modified to document the browser used.
    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\TorBrowser]
    @="Tor Browser"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\TorBrowser\Capabilities]
    "ApplicationName"="Tor Browser"
    "ApplicationDescription"="Privacy-preserving browser using Tor"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\TorBrowser\Capabilities\FileAssociations]
    ".htm"="TorBrowserHTML"
    ".html"="TorBrowserHTML"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\TorBrowser\Capabilities\URLAssociations]
    "http"="TorBrowserHTML"
    "https"="TorBrowserHTML"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TorBrowserHTML\shell\open\command]
    @="\"C:\\path\\to\\torbrowser_launcher.exe\" \"%1\""

    [HKEY_LOCAL_MACHINE\SOFTWARE\RegisteredApplications]
    "Tor Browser"="Software\\Clients\\StartMenuInternet\\TorBrowser\\Capabilities"

    Now, any app or system call that tries to open a URL using the default
    browser will launch the Tor Browser instead.

    This simple default Mozilla-based browser setup ensures:
    a. Rogue URLs are routed through Tor.
    b. No automatic connections unless Tor is manually connected.
    c. Enhanced privacy and control over web sessions.

    Note you can also register the Mozilla-based Tor browser
    as an HTML browser alone, but this wrapper provides more
    control as you can easily add logging sessions to it.
    --- Synchronet 3.21a-Linux NewsLink 1.2