Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

Including XP Firewall Exceptions in a Deployment Job

Updated: 07 Oct 2008
dnorris's picture
0 0 Votes
Login to vote

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
goto exit

:Is_XP
:Run Windows XP-specific commands here.
netsh.exe firewall set allowedprogram program = "C:\Program Files\SomeApp\App.exe" name = "SomeAppException" mode = ENABLE profile = ALL

:exit