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

preview_player
Показать описание
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
--------

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

-----------------------------
-----------------------------

Everything in this video is my personal opinion and experience, and should not be considered professional advice. Always do your own research and make sure what you're doing is safe.
Рекомендации по теме
Комментарии
Автор

You explained it so perfectly, i gotta give you props for that. Makes it so much easier to understand for people that don't do a whole lot on the command line.

RetoonHD
Автор

This was so much easier than adding 50 exe's by hand. Thank you!

SpecOps
Автор

Really appreciate this video for not only providing a solution, but clearly explaining how it works!

sm
Автор

My guy. The most informative and well explained video I've found so far. It's even fun to learn these new things and not a drag.

mustbestopped
Автор

Just incase if anyone wanna block just the .dll - add .dll next to *.exe for example (*.exe, .dll) or just (*.dll). Thanks for the tutorial mate

Jebesniper
Автор

YouTube needs a triple like button. This was such a good video. Not only is your solution PERFECT but you explain it very well for those who can't read code or know all of the parameters.

Dudanation
Автор

Excellent script - great job! Thank you for sharing; saved me a lot of time.

njellis
Автор

Thank you so much, this is so awesomely helpful. I was doing this by hand in apps that have dozens, maybe hundreds of exe components. Thankfully I was only less than half way through when I thought 'there has to be a better way' and found your video. It made it a breeze. Cheers!

dbitMedia
Автор

This Channel deserves more
It's solves the very problems whose solutions you cannot find anywhere else.
Also he also explains the reason why we are using that code which nobody else cares to tell.
Best Of luck for the Future brother....

yoractualvoice
Автор

Comes up as top result for "windows 10 firewall block folder" and truly deserves it. Thank you.

L
Автор

Deadly, works so well. I've wanted this for years now.

s.fleming
Автор

Thank you! Loved the video. Concise, everything covered and explained!

vadimkolosov
Автор

Don't forget to edit batch file for .DLLs as well, because these are also executable files and may be invoked indirectly to connect to the Internet.

pcnerve
Автор

Dude, how is this brilliant gem hidden. This needs to go viral. Thanks a ton mate!

TheHardknok
Автор

Thanks so much for creating this easy to follow video... I was a little confused at specifying target .exe directory but then figured if the batch file is within that directory that's what the '%' points to...

scottplooster
Автор

That was such a good explanation and demo. thanks!

shivam.shakya
Автор

Amazing was searching for folder blocking, everyone else was showing single file only thank you so much

kevinlevin
Автор

This is a masterpiece for free. Thanks for doing this, big man! Keep it up.

hipnologoycarosantos
Автор

Amazing video! Thanks. Your channel is a hidden gem.

drcinematic.youtube
Автор

Extremely useful! Thank you so much for this!

eduardohungaro