Robbie said:
Is there any way of opening a range of ports on the XP sp2 firewall?
e.g. if I want to open up ports 15000 - 15200 (udp and tcp).
Hi,
Running netsh.exe in a script is an option.
The netsh.exe syntax is documented in WF_XPSP2.doc.
WF_XPSP2.doc "Deploying Windows Firewall Settings for Microsoft
Windows XP with Service Pack 2" is downloadable from
http://www.microsoft.com/downloads/details.aspx?familyid=4454e0e1-61fa-447a-bdcd-499f73a637d1
Example VBScript below, change name, scope, profile to
what fits you.
'--------------------8<----------------------
Set oShell = CreateObject("WScript.Shell")
iPortStart = InputBox("Enter the first port you want to open", _
"Open a range of ports")
iPortStop = InputBox("Enter the last port you want to open", _
"Open a range of ports")
For i = iPortStart To iPortStop
oShell.Run "netsh.exe firewall add portopening protocol=all port=" & i _
& " name=BLA" & i & " mode=enable scope=subnet profile=domain", 0, True
Next
MsgBox "Finished adding ports", _
vbInformation + vbSystemModal, "Adding FW ports"
'--------------------8<----------------------
WSH 5.6 documentation (local help file) can be downloaded from here
if you haven't got it already:
http://msdn.microsoft.com/downloads/list/webdev.asp