When packaging an application requiring an exception within the XP firewall, you can automate the exception using netsh.
The XP firewall can be configured using the firewall command of the netsh utility. For full usage options, type the following:
netsh firewall ?
To add a program exception to the firewall, you will need to specify a descriptive name for the exception and the path to the executable. For this example, we'll use a description of SomeAppException and an executable path of C:\Program Files\SomeApp\App.exe.
The following script performs a check to ensure that XP is running, then calls the netsh command.
REM Allow exception in XP Firewall
REM Only perform this for XP
ver | find "XP" > nul
if %ERRORLEVEL% == 0 goto Is_XP
:Run Windows XP...