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.
36 lines
1.1 KiB
Batchfile
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 |