Welcome to weblogs.com.pk Sign in | Join | Help

netsh :: Opening range of ports in Windows Firewall

Today I happened to configure a machine for ACCPAC; which is an entry level ERP solution from SAGE. ACCPAC offers internet accessibility using either DCOM or .NET Remoting. For .NET Remoting it uses multiple ports where it opens up listeners as the client logon and uses different interfaces. I had configured Windows Firewall; the problem was that I had to make a rule it so that I can open up a range of ports for .NET Remoting. Unfortunately Windows Firewall doesn’t allow making such rule; and one has to make rule for each port that you want to open. I didn’t wanted to use any third party firewall; as Windows Firewall is pretty stable, light and rock solid implementation. Fortunately there exists a command NETSH using which one can manage Windows Firewall from command prompt. Here is a sample command to open up one port

netsh firewall add portopening TCP 5001 "ACCPAC-5001"

If you know the good old DOS’ FOR loop; it must be a piece of cake to execute this command for multiple ports; but its been almost a decade since I used DOS’ stuff; so I created an excel sheet and using simple text concatenation functions I created the BAT files having above commands for multiple ports…. Smile

And sorry K. Hanif; I couldn’t made the visit at your place. We are done with the training sessions; and I will try to visit your place tomorrow at around 10:30. Does it suites?

Published Thursday, June 22, 2006 6:02 PM by khurram


No Comments

New Comments to this post are disabled