Скрипт убирает блокирующие правила Windows: они сильнее разрешающих

quiz.exe — копия node.exe, Windows опознаёт его как Node.js. Если в запросе
про доступ нажать Отмена, создаётся Block-правило, и порт 3000 не работает
при открытом разрешающем правиле. Скрипт удаляет такие правила по пути.
This commit is contained in:
oskarvitalii committed 2026-11-23 12:21:01 +07:00
1 parent d5d36ef511
commit 1602c94b11
3 files changed
+20 -4

No files matched your search

+8
View File
@@ -18,6 +18,14 @@ exit /b
:work
set "FOLDER=%~dp0"
rem Windows ??????? Block-???????, ???? ? ??????? ??? ?????? ?????? "??????".
rem ??????????? ??????? ??????? ????????????, ??????? ??????? ??????? ??.
echo.
echo Removing block rules for this program, if any
powershell -NoProfile -ExecutionPolicy Bypass -Command "$exe='%FOLDER%quiz.exe'; Get-NetFirewallRule -Direction Inbound -Action Block -ErrorAction SilentlyContinue | Where-Object { ($_ | Get-NetFirewallApplicationFilter).Program -ieq $exe } | Remove-NetFirewallRule -ErrorAction SilentlyContinue"
if errorlevel 1 echo [!] not removed
if not errorlevel 1 echo [ok] block rules cleared
set "RULE_APP=Quiz Server app"
set "RULE_PORT=Quiz Server port 3000"
set "RULE_DEV=Quiz Server dev port 5173"