Windows: Create Firewall Rules using cmd

Syntax
netsh advfirewall firewall add rule name="RULENAME" dir=[in/out] action=[allow/block/bypass] protocol=[tcp/udp] localip=[any] remoteip=[any]
Block program (executable)
netsh advfirewall firewall add rule name="BlockProgram" dir=out program="c:\temp\programtoblock.exe" profile=any action=block
Allow port
netsh advfirewall firewall add rule name="allowHTTP" dir=in action=allow protocol=TCP localport=80

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *