Saturday, June 23, 2018

Windows Firewall Block all Programs in a Folder

So..Say you want to block all internet connections for an exe(s) in a Windows folder, this bat file will Block All Internet connections save below cmds to a bat file, save to a folder with the exe(s) you want to block, and then Run this bat file. Voila!


@ setlocal enableextensions 
@ cd /d "%~dp0"

for /R %%a in (*.exe) do (

netsh advfirewall firewall add rule name="Blocked with Batchfile %%a" dir=out program="%%a" action=block

)
 

No comments:

Post a Comment