Solved

Programmatically opening a port on Windows with a script.

Posted on 2008-10-27
4
519 Views
Last Modified: 2012-08-13
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
0
Comment
Question by:FreightTrain
4 Comments
 
LVL 3

Accepted Solution

by:
siranm earned 500 total points
Comment Utility
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
 
LVL 95

Expert Comment

by:Lee W, MVP
Comment Utility
0
 

Author Closing Comment

by:FreightTrain
Comment Utility
Perfect Solution.  Thank you so much!  I didn't realize something like this would be so easy!!!  
0
 
LVL 4

Expert Comment

by:choswoot
Comment Utility
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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The use of stolen credentials is a hot commodity this year allowing threat actors to move laterally within the network in order to avoid breach detection.
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now