Files
web-vnc/scripts/open-firewall.bat
T
Codex 0779b4327c Translate run.bat and open-firewall.bat to English ASCII
Convert the .bat scripts from Russian (UTF-8 with BOM + chcp 65001) to plain
English ASCII without BOM/chcp, so they render correctly under any OEM console
codepage without relying on BOM handling.
2026-07-31 21:44:42 +03:00

36 lines
1.1 KiB
Batchfile

@echo off
REM ============================================================
REM open-firewall.bat - opens port 8080 in the Windows Firewall.
REM Run as administrator (once). Or just launch it: it will request
REM admin rights itself.
REM ============================================================
cd /d "%~dp0"
REM Admin check + auto-elevate.
net session >nul 2>nul
if errorlevel 1 (
echo Requesting administrator rights ...
powershell -Command "Start-Process -FilePath '%~f0' -Verb RunAs"
exit /b
)
set PORT=8080
set RULE=web-vnc
echo Removing the old rule (if any) ...
netsh advfirewall firewall delete rule name="%RULE%" >nul 2>nul
echo Adding an allow rule for inbound TCP traffic on port %PORT% ...
netsh advfirewall firewall add rule name="%RULE%" dir=in action=allow protocol=TCP localport=%PORT%
if errorlevel 1 (
echo [error] Could not add the rule.
pause
exit /b 1
)
echo.
echo Done. Port %PORT% is open for inbound connections.
echo You can now connect to web-vnc from other machines on the network at:
echo http://THIS_MACHINE_IP:%PORT%
echo.
pause