Skip to content

Instantly share code, notes, and snippets.

View sean1832's full-sized avatar

Zeke Zhang sean1832

View GitHub Profile
@sean1832
sean1832 / block-exe-firewall.bat
Created November 5, 2025 09:54
Automatically add all .exe file to firewall rule
@echo off
:: -- Self-elevation check --
NET SESSION >nul 2>&1
if %ERRORLEVEL% NEQ 0 (
echo Requesting administrative privileges...
powershell -Command "Start-Process -FilePath '%~f0' -Verb runAs"
exit /B
)
:: -- Elevated --