0
votes

I was doing some experiments with firewall and in result I have added some firewall rules which doesn't have exe attached to them. Now I am unable to remove these from firewall. Remove button is disabled for those rules when I go to "Allow app to firewall" and in program I am also unable to do that as it processes exe path instead of rule name. What should I do now? How to remove these entries?

Here is my remove code.

Type objectType = Type.GetTypeFromCLSID(new Guid(CLSID_FIREWALL_MANAGER));
var firewallManger = Activator.CreateInstance(objectType) as NetFwTypeLib.INetFwMgr;
firewallManger.LocalPolicy.CurrentProfile.AuthorizedApplications.Remove(imagePath); //imagePath is exe path.
1

1 Answers

0
votes

go to Windows-Firewall -> "Advanced Settings" instead of "Allow app to Firewall" in the incomming rules you should be able to delete it