TroubleChute Logo
VIDEOS

Windows: How to Block an entire folder | Windows Firewall Guide


Published: Sep 25, 2020
Last Edit: Sep 25, 2020
108 Words, 0 Minute.

Watch the video:


Timestamps:
0:00 - Explanation
1:23 - Creating .bat file
2:06 - Command explanation
3:32 - Blocking IN and OUT data
4:09 - Blocking all files in a folder in Windows Firewall

Wanted to block a program, and all the other .exe’s in a folder? Well, it’s difficult. With the help of a small .bat file, life can be made simpler. This video shows you how to completely block or allow an entire folder (and subfolders) internet access via the Windows Firewall.

——–
@ 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
) pause

TroubleChute © Wesley Pyburn (TroubleChute)
Support Me Privacy Policy Cookies Policy Terms of Service Change privacy settings Contact