You can use netsh if you need add some exceptions for your application.
write in command line (for XP):
netsh firewall add allowedprogram ?
write in command line (for W7):
netsh advfirewall firewall add rule ?
This difference becouse netsh firewall command is deprecated. Instead, we have to use the command netsh advfirewall firewall.
More information about using the command netsh advfirewall firewall instead of the netsh firewall command we can see in Knowledge Base there: http://go.microsoft.com/fwlink/?linkid=121488
Examples:
Adding a rule for incoming traffic without security encapsulation for messenger.exe:
netsh advfirewall firewall add rule name="allow messenger" dir=in program="c:programfilesmessengermsmsgs.exe" security=authnoencap action=allow
Adding a rule for outgoing traffic at the port 80:
netsh advfirewall firewall add rule name="allow80" protocol=TCP dir=out localport=80 action=block
Adding rules to inbound traffic with safety & traffic encryption for TCP through port 80:
netsh advfirewall firewall add rule name="Require Encryption for Inbound TCP/80" protocol=TCP dir=in localport=80 security=authdynenc action=allow
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…