Programmatically opening a port on Windows with a script.

I have an application that communicates on a port via TCP/IP and I want the user to be able to run a batch file that will open a specified port through the Windows Firewall.  I am unsure as to what I need to do.  Please let me know.

Thanks,

JP
FreightTrainAsked:
Who is Participating?
 
siranmConnect With a Mentor Commented:
Hi,

this should get you going:


for example: command: netsh firewall set portopening TCP 80 http

i got it from
http://support.microsoft.com/kb/839980

which led me to:
http://securetrends.typepad.com/secure_trends/2007/10/command-line-fi.html
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
0
 
FreightTrainAuthor Commented:
Perfect Solution.  Thank you so much!  I didn't realize something like this would be so easy!!!  
0
 
choswootCommented:
all = TCP + UDP ; change to need
10550 port change to port needed
TEST - chnage to Exceptions Name

Add this to your batch file
netsh firewall set portopening all 10550 TEST ENABLE
0
All Courses

From novice to tech pro — start learning today.