如何使用 netsh 从 Windows 防火墙规则中清除程序/服务

如何使用 netsh 从 Windows 防火墙规则中清除程序/服务

我想使用 netsh.exe 修改现有的 Windows 防火墙规则,删除规则中的“程序”和“服务”部分。换句话说,我想将其设置为“满足指定条件的所有程序”和“应用于所有程序和服务”。我找不到办法。

这是我尝试过的:

netsh advfirewall 防火墙设置规则名称 =MyRule 新程序 =

错误:应用程序包含无效的字符或长度

和:

netsh advfirewall 防火墙设置规则名称 = MyRule 新程序 =“”

错误:应用程序包含无效的字符或长度

和:

netsh advfirewall 防火墙设置规则名称 = MyRule 新程序 = ''

创建一个程序路径,实际上是“”

和:

netsh advfirewall 防火墙设置规则名称 = MyRule 新程序 = any

创建一个程序路径,实际上是任何

编辑:我使用的是 Windows 7,因此 PowerShell Set-NetFirewallRule cmdlet 不是一个选项。

相关内容