home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch      Fun with MS-DOS batch files      42,547 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 42,460 of 42,547   
   Marion to All   
   Tutorial: How to set up any batch script   
   19 Aug 25 15:33:05   
   
   XPost: alt.comp.software.firefox, alt.privacy   
   From: marion@facts.com   
      
   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.   
       
       
    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:   
    C:\> 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\DummyBro   
   ser\Capabilities]   
    "ApplicationName"="Dummy Browser"   
    "ApplicationDescription"="A privacy-preserving dummy browser"   
      
    [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\DummyBro   
   ser\Capabilities\FileAssociations]   
    ".htm"="DummyBrowserHTML"   
    ".html"="DummyBrowserHTML"   
      
    [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\DummyBro   
   ser\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\\DummyBro   
   ser\\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.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca