Solved

Programmatically opening a port on Windows with a script.

Posted on 2008-10-27
4
537 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
ID: 22817017
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
ID: 22817081
0
 

Author Closing Comment

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

Expert Comment

by:choswoot
ID: 22817182
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

786 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