From Newsgroup: alt.msdos.batch
Marion wrote:
End of C:\data\sys\ahk\alohavpn.ahk
I should point out that to use it, all you need to do is make a shortcut
with the path to the AutoHotKey script as its TARGET.
alohavpn.lnk
TARGET = C:\path\to\ahk\alohavpn.ahk
The AHK script turns the aloha vpn browser from almost unusable crippleware
to reasonably usable freeware.
I would still recommend having a system-wide VPN or proxy in the background (just in case) where this script does the trick using Psiphon freeware.
@echo off
REM C:\data\sys\batch\psiphon.bat version 1.0 20250819
REM This is psiphon.bat version 2.2 (??? lines)
REM Runs "C:\app\network\psiphon\psiphon3.exe" -mode=socks
REM This method leaves windows open.
REM %comspec% /k C:\app\network\psiphon\psiphon3.exe -mode=socks
REM This method closes windows.
REM psiphon.bat version 1.1 20250916
REM Added automatic PAC sync/apply after Psiphon launch
REM psiphon.bat version 1.2 20250916
REM Added logging to proxy.log when PAC is triggered from psiphon
REM psiphon.bat version 1.3 20250916
REM Added optional pause for viewing output before closing
REM psiphon.bat version 1.4 20250916
REM Changed to never close parent cmd window and always pause at end
REM psiphon.bat version 1.5 20250916
REM Added self-elevation to request UAC if not already admin
REM psiphon.bat version 1.6 20250916
REM Added final PAC URL + Auto-Detect set to ensure persistence
REM after Psiphon/proxy changes
REM psiphon.bat version 1.7 20250917
REM Added launch of mongoose.vbs to serve proxy.pac before PAC logic
REM psiphon.bat version 1.8 20250917
REM Reordered launch sequence: Mongoose now starts BEFORE Psiphon
REM Added PAC availability check using curl
REM Added 2-second wait after Mongoose launch to ensure readiness
REM psiphon.bat version 1.9 20250917
REM Error: PAC file not available. Aborting. Press any key to continue
REM Increased delay from 2 to 4 to give Mongoose more time to bind & serve
REM psiphon.bat version 2.0 20250917 (111 lines)
REM Decreased delay back to 2 as it didn't make a difference
REM Added echo message during Mongoose wait to indicate progress
REM psiphon.bat version 2.1 20250917 (118 lines)
REM Expanded Psiphon's reach to WinHTTP apps without compromising WinINET apps
REM By adding Automatic Sync of WinINET to WinHTTP (e.g., for Windows Update)
REM Transfers only the Psiphon-injected static HTTP/HTTPS proxy address
REM Does not transfer PAC logic and SOCKS settings from WinInet to WinHTTP
REM psiphon.bat version 2.2 20250920 (??? lines)
:: --- 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 Launch Mongoose silently to serve proxy.pac
cscript //nologo "C:\data\sys\batch\launchmongoose.vbs"
REM Wait for Mongoose to initialize (added in v1.8)
echo waiting for mongoose... (added in v2.0)
timeout /t 2 /nobreak >nul
REM Verify PAC file is available before proceeding (added in v1.8)
curl --silent --fail
http://127.0.0.1/proxy.pac >nul || (
echo PAC file not available. Aborting.
pause
exit /b
)
REM Launch Psiphon in SOCKS mode
start "" /D "C:\app\network\psiphon" psiphon3.exe -mode=socks
REM Wait a few seconds for Psiphon to initialize
timeout /t 5 /nobreak >nul
REM Log that PAC is being run from psiphon
echo [%DATE% %TIME%] pac.cmd triggered from psiphon.bat >> C:\data\sys\log\proxy.log
REM Apply PAC logic automatically (silent mode)
call "C:\data\sys\batch\pac.cmd" /silent
REM Force PAC URL and Auto-Detect to desired values at the very end
REM This ensures Psiphon or proxy sync cannot leave them unset
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoConfigURL /t REG_SZ /d
http://127.0.0.1/proxy.pac /f >nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoDetect /t REG_DWORD /d 1 /f >nul
REM Sync WinINET proxy settings into WinHTTP (added in v2.1)
netsh winhttp import proxy source=ie
REM Always pause so you can see output if run from a console
echo.
echo Press any key to close...
pause >nul
REM End batch without killing the shell
exit /b
::START: You type Win+R -> psiphon
:: |
:: v
::psiphon.bat
:: - Check if running as admin
:: - If not, request UAC elevation and restart
:: - Launch mongoose.vbs to serve proxy.pac (moved earlier in v1.8)
:: - Wait 2 seconds for Mongoose to initialize (added in v1.8)
:: - Echo "waiting for mongoose..." during delay (added in v1.9)
:: - Verify PAC file is accessible via curl (added in v1.8)
:: - Launch psiphon3.exe in SOCKS mode
:: - Wait 5 seconds for Psiphon to initialize
:: - Log that pac.cmd is being run
:: - Call pac.cmd /silent
:: |
:: v
:: pac.cmd
:: - Log run
:: - Run proxy.cmd /sync to align WinINET -> WinHTTP
:: - Capture current PAC URL and Auto-Detect status
:: - If missing or wrong, call proxy.cmd with PAC URL
:: - Force set PAC URL and Auto-Detect in registry
:: - Re-capture status so final display is accurate
:: - Show final PAC and Auto-Detect status
:: - Return to psiphon.bat
:: - Force set PAC URL and Auto-Detect again (double guarantee)
:: - Pause for user to see output
:: - Exit without closing parent shell
::END
--- Synchronet 3.21a-Linux NewsLink 1.2