Use netsh advfirewall to Add windows 7 firewall exception [closed]

谁说胖子不能爱 提交于 2019-12-06 09:37:06

问题


Hi I am adding a firewall exception to Windows 7 using netsh. The simple rule i am adding is:

netsh advfirewall firewall add rule name = "The Test App3" dir = in action = allow description = "Smart Cipher inbound messages" program = "C:\temp\a.exe"

The problem is that after executing this command a new rule is added to the firewall and is displayed within the firewall console - but it seems it is not properly configured for two reasons: 1. The Remove button in the firewall console is disabled 2. Clicking the Details... button show no details for the rule, unlike other "good rules", but only name and description

Please advice

Tx

Oren


回答1:


added only profiles arguments to yours command line also removed all those spaces ...="... all works fine.

ps: Vikram.exe: default is enabled=yes (true)

here is what I got at the end:

netsh advfirewall firewall add rule name="Visaris Diagon 3.1 Administration" dir=in action=allow profile=any description="Visaris Diagon 3.1 Administration" program="C:\Program Files (x86)\Visaris\Visaris Diagon 3.1\Visaris.Diagon.Administration.exe"

netsh advfirewall firewall add rule name="Visaris Diagon 3.1 Administration" dir=out action=allow profile=any description="Visaris Diagon 3.1 Administration" program="C:\Program Files (x86)\Visaris\Visaris Diagon 3.1\Visaris.Diagon.Administration.exe"




回答2:


Try adding the "enable" sub command and removing the spaces

eg:

netsh advfirewall firewall add rule name="The Test App3" dir=in action=allow
description="Smart Cipher inbound messages" program="C:\temp\a.exe" enable=yes


来源:https://stackoverflow.com/questions/4579643/use-netsh-advfirewall-to-add-windows-7-firewall-exception

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!