Can I use Windows Firewall to prevent certain programs from sending or receiving traffic to and from sources and destinations beyond my local computer? It seems like subnets/subnet masks may be necessary, but I’m not confident in my understanding of how they function. For example, when I attempted to use as a mask to permit traffic, it appeared to enable all traffic to pass through the firewall.

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

Until now, I’ve been utilizing the two commands mentioned earlier to prevent any communication, but now I require the ability for these programs to interact within the same computer.

If you could offer any assistance, it would be greatly appreciated. Thank you!

Askify Moderator Edited question April 23, 2023