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,482 of 42,547   
   Marion to All   
   Re: Tutorial: Build a one-click Windows    
   21 Sep 25 04:34:45   
   
   XPost: alt.comp.os.windows-10, alt.comp.os.windows-11   
   From: marionf@fact.com   
      
   UPDATE   
      
   In another thread today I described how I installed & ran a YouTube client   
   that allowed me to view YouTube videos without logging in & without any ads   
   (both the type of ads that YouTube inserts & even creator-inserted ads).   
    a. Pre-roll ads (before the video starts)   
    b. Mid-roll ads (interrupting the video)   
    c. Banner ads (overlaying the video)   
    d. Sidebar ads (on the YouTube page)   
    e. Sponsor blocks (remove known ads inserted by creators)   
          
      
   The YouTube client I tested today was FreeTube, which worked well.   
   But it was obstinate during a proxy that it didn't like my proxy.   
   Worse, AFTER the proxy was shut down, it failed until I rebooted.   
      
   Huh?   
   Why did FreeTube barf when I killed the proxy but nothing did before it?   
      
   Turns out my script to kill the proxy needed a LOT of improvements!   
   The FreeTube "app" is apparently a web browser using system-proxy settings.   
      
   It was still using "some" of the proxy settings even though the proxy   
   was no longer running. I hadn't noticed before that this happened.   
      
   Hence, here's a working script to KILL the proxy & wipe it off Windows.   
      
    @echo off   
    REM C:\data\sys\batch\psiphonstop.bat version 1.0 20250819   
    REM This is psiphonstop.bat version 1.9   
    REM Close Psiphon GUI first to let it attempt its own cleanup.   
    REM Then run psiphonstop.bat to:   
    REM 1. Check for any lingering processes (Psiphon or Mongoose).   
    REM 2. Kill any lingering processes (Psiphon or Mongoose).   
    REM 3. Reset WinINET and WinHTTP proxy settings.   
    REM 4. Log the shutdown for traceability in mongoose & proxy logs.   
    REM Additions in version 1.0 (41 lines)   
    REM As admin, it stops Psiphon GUI, Mongoose, and resets proxy settings   
    REM Logs shutdown event to proxy.log and mongoose.log for lifecycle tracking   
    REM Changes in version 1.1 (46 lines)   
    REM Added Psiphon GUI termination step (v1.1)   
    REM Added [STOP] prefix to log entries for clarity (v1.1)   
    REM Changes in version 1.2 (56 lines)   
    REM Added conditional checks for running processes before attempting kill/log   
    REM Only logs shutdown events if process was found running   
    REM 20250920 psiphonstop.bat 1.3 (68 lines)   
    REM Fixed Registry Key Not Found error when run with nothing to do   
    REM Fixed "reset" not a command error by removing the ampersand in the echo   
    REM 20250920 psiphonstop.bat 1.4 (79 lines)   
    REM Added better error checking to see if Psiphon or Mongoose are running   
    REM Added a closer line in the console   
    REM 20250920 psiphonstop.bat 1.5 (89 lines)   
    REM Added better explanation of the registry changes in the console output   
    REM 20250920 psiphonstop.bat 1.6 (108 lines)   
    REM Set ProxyEnable to 0 so the system knows to bypass proxies (v1.6)   
    REM Clear ProxyOverride if Psiphon used custom bypass rules (v1.6)   
    REM Flush DNS and restart networking stack (v1.6)   
    REM 20250920 psiphonstop.bat 1.7 (121 lines)   
    REM Exported keys before deletion, just in case (v1.7)   
    REM fully refresh network adaptor (optional) v1.7   
    REM 20250920 psiphonstop.bat 1.8 (138 lines)   
    REM Check for environment proxy settings (v1.8)   
    REM add browser cache flush and settings reminder (v1.8)   
    REM add summary log entry with system state (v1.8)   
    REM Add a success beep or visual cue (v1.8)   
    REM 20250920 psiphonstop.bat 1.9 (152 lines)   
    REM Added version banner   
    REM Log envvars (v1.9)   
    REM Add browser-specific cleanup reminders (v1.9)   
      
    echo ----------------------------------------   
    echo Psiphonstop.bat v1.9 - Proxy Reset Tool   
    echo ----------------------------------------   
      
    :: --- Elevate to admin if not already ---   
    >nul 2>&1 net session   
    if %errorlevel% neq 0 (   
        echo Requesting administrative privileges...   
        powershell -Command "Start-Process '%~f0' -Verb RunAs"   
        exit /b   
    )   
      
    REM Check if Psiphon GUI is running (updated for better errors) v1p4   
    tasklist /fi "imagename eq psiphon3.exe" | find /i "psiphon3.exe" >nul   
    if %errorlevel%==0 (   
        taskkill /f /im psiphon3.exe >nul 2>&1   
        echo [%DATE% %TIME%] [STOP] Psiphon GUI terminated by psiphonstop.bat >>   
   C:\data\sys\log\proxy.log   
    ) else (   
        echo [%DATE% %TIME%] [STOP] No Psiphon GUI process found >>   
   C:\data\sys\log\proxy.log   
    )   
      
    REM Check if Mongoose is running (updated checks in v1.4)   
    tasklist /fi "imagename eq mongoose.exe" | find /i "mongoose.exe" >nul   
    if %errorlevel%==0 (   
        taskkill /f /im mongoose.exe >nul 2>&1   
        echo [%DATE% %TIME%] [STOP] Mongoose terminated by psiphonstop.bat >>   
   C:\data\sys\batch\mongoose.log   
    ) else (   
        echo [%DATE% %TIME%] [STOP] No Mongoose process found >> C:   
   data\sys\batch\mongoose.log   
    )   
      
      
    REM Exported keys before deletion, just in case (v1.7)   
    reg export "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings"   
   C:\data\sys\log\proxy_before_reset.reg   
      
    REM Reset WinINET proxy settings   
    echo Resetting WinINET proxy registry values...   
    REM Fixed Registry Key Not Found error when run with nothing to do (v1.3)   
    :: reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet   
   Settings" /v AutoConfigURL /f >nul   
    reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings"   
   /v AutoConfigURL /f 2>nul   
      
    echo reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet   
   Settings" /v AutoConfigURL /f 2>nul   
      
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v   
   AutoDetect /t REG_DWORD /d 0 /f >nul   
      
    echo reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet   
   Settings" /v AutoDetect /t REG_DWORD /d 0 /f >nul   
      
    :: reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet   
   Settings" /v ProxyServer /f >nul   
    reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings"   
   /v ProxyServer /f 2>nul   
    echo reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet   
   Settings" /v ProxyServer /f 2>nul   
      
    :: reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet   
   Settings" /v ProxyEnable /f >nul   
    reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings"   
   /v ProxyEnable /f 2>nul   
    echo reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet   
   Settings" /v ProxyEnable /f 2>nul   
      
    REM v1p6   
    REM Deleting ProxyEnable and ProxyServer does not restore direct access.   
    REM Set ProxyEnable to 0 so the system knows to bypass proxies (v1.6)   
    REM Windows interprets missing values differently than explicitly set ones.   
    REM Explicitly set ProxyEnable to 0 so the system knows to bypass proxies.   
    REM Now Windows knows to use direct access, not ´no proxy server defined.¡   
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v   
   ProxyEnable /t REG_DWORD /d 0 /f   
      
      
   [continued in next message]   
      
   --- 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