Skip to content

Instantly share code, notes, and snippets.

@RecNes
Last active October 30, 2025 08:18
Show Gist options
  • Select an option

  • Save RecNes/49b73d0b9f51d2def76e381e74df823a to your computer and use it in GitHub Desktop.

Select an option

Save RecNes/49b73d0b9f51d2def76e381e74df823a to your computer and use it in GitHub Desktop.
Network jailer for EXE files. Save as batch faile and execute under the folder where the executable you want to jail.
@ setlocal enableextensions
@ cd /d "%~dp0"
for /R %%f in (*.exe) do (
netsh advfirewall firewall add rule name="Blocked: %%f" dir=out program="%%f" action=block
netsh advfirewall firewall add rule name="Blocked: %%f" dir=in program="%%f" action=block
)
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment