尝试应用此↓命令时禁用Windows防火墙服务
netsh advfirewall firewall add rule name="My App (HTTP-In)" dir=in action=allow protocol=TCP localport=1234 remoteip=localsubnet program=SYSTEM
导致此错误:
An error occurred while attempting to contact the Windows Firewall service. Make sure that the service is running and try your request again.
我知道您可以通过向此↓键添加值来直接通过注册表编辑器添加规则,但我想省略这种方式。
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules
问题是:在禁用Windows防火墙服务时是否有其他方法可以添加防火墙规则?