"Netsh Advfirewall Firewall Delete Rule Name Program" Syntax Not Working

"Netsh Advfirewall Firewall Delete Rule Name Program" Syntax Not Working

I'm trying to delete a Windows Firewall rule from command line using netsh. I'm trying with the below syntax; however, it is not working for me result wise.

netsh advfirewall firewall delete rule program="C\Program Files (x86)\utorrent\uTorrent.exe"

What is the correct syntax for this? I am using Windows 7 Ultimate 64-bit.

0

3 Answers

Don't use the "Program" parameter and value, use "Rule" name in the delete statement.

You can run netsh advfirewall firewall show rule status=enabled name=all or perhaps netsh advfirewall firewall show rule status=enabled name=all | FIND /I "uTorrent" to get a list of the rules that are enabled to help location the actual name of the rule.

Once this is determined, you can run netsh advfirewall firewall delete rule name="<Rule Name>" and plug the name of the rule in accordingly for it to remove that rule.

Examples

Create a rule with the name "IP Block"

netsh advfirewall firewall add rule name="IP Block" dir=in interface=any action=block remoteip=<IPaddress>/32

Delete a rule with the name "IP Block"

netsh advfirewall firewall delete rule name="IP Block"

James H. Sterling
Author

James H. Sterling

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.