Enabling Windows Firewall ports via batch files Any Windows os


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



Below script works on Win XP, 2000 and 2003
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
ZackGeneral IT Goto GuyAuthor Commented:
Closest solution to what I was looking for.

Thank you.
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.