Solved

Programmatically opening a port on Windows with a script.

Posted on 2008-10-27
4
544 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This is an article about Leadership and accepting and adapting to new challenges. It focuses mostly on upgrading to Windows 10.
NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

829 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