I've written a script that adds two registry keys which will disbale WIndows Firewall
At the end is a sample script I wrote using resources at Script Centre on TechNet mixed in with some time on my side.
I've only just started scripting so its not pretty or fantatsic but it achieved what I wanted and I posted it on our company Intranet site so users download and run it from the site.
Summary
The script adds two registry keys to Windows XP machines that means when Windows XP Service Pack 2 is installed the Windows Firewall is disabled by default, instead of enabled as programmed. It also displays a message advising the user that changes have been made. The script works fine in an AD environment on remote machines but I couldn't run it on remote machines that are within our private IP range but are not on Active Directory (i.e. branch machines connected via VPN).
This script was built to be applied prior to installation of SP2 but can be run after SP2 installation to disable Windows Firewall. To reverse the changes you simply delete the new registry keys, ideally you would run a script to do this of course but I haven't got round to writing and testing that one yet.
Known issues
On Windows 95 & Windows 98 a message will pop up to advise that you are running Windows XP and changes have been made.
This message should be ignored as no changes were made to the registry. Its just that the script failed to correctly identify the Operating System. Unfortunately I didn't have the time to work out how to fix that one!
VBscript follows
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,48)
For Each objItem in colItems
If objItem.caption = "Microsoft Windows XP Professional" then
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
strValueName = "EnableFirewall"
dwValue = 0
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
strKeyPath = "SOFTWARE\Policies\Microsoft\WindowsFirewall\StandardProfile"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
strValueName = "EnableFirewall"
dwValue = 0
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
WScript.echo "Your computer is using Microsoft Windows XP Professional." &_
" Therefore a change to your settings has been made to disable the Windows " &_
"Firewall in Windows XP Service Pack 2. *** IT Department ***"
ElseIf Not objItem.Caption = "Microsoft Windows XP Professional" then
WScript.echo "Your computer is not using Microsoft Windows XP Professional." &_
" Therefore you will not be affected by Windows XP Service Pack and no changes " &_
"have been made.*** IT Department ***"
End If
Next