Enabling Windows Firewall ports via batch files Any Windows os

Heyas,

Is their any batch file command that will enable windows firewall ports on the following operating systems Windows XP, Vista, Windows 7.

Thank you.
ZackGeneral IT Goto GuyAsked:
Who is Participating?
 
Sushil SonawaneCommented:
You can enable ports through group policy also.

Please refer below link

(http://www.intelliadmin.com/index.php/2008/12/enable-file-and-printer-sharing-using-group-policy-2/)

(http://www.intelliadmin.com/index.php/2008/12/enable-file-and-printer-sharing-using-group-policy-2/)


Below script works on Win XP, 2000 and 2003
 
=======================================================
 
@ ECHO OFF
 
netsh firewall add allowedprogram Program.exe ProgramName ENABLE
 netsh firewall add portopening all 8888 Program-8888 enable
 netsh firewall add portopening all 9090 Program-9090 enable
0
 
ZackGeneral IT Goto GuyAuthor Commented:
Closest solution to what I was looking for.

Thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.