Sunday 09 May 2004

How to disable the Windows XP Firewall in 3 lines of VBScript

I found this blog post via Delicious.

The scripts posted by the author are meant to be run locally on each machine and are potentially useful in that it may be possible in future for a Systems Administrator to use them to configure several PCs via Logon Scripts. The author believes that the scripts cannot be run remotely and he may be right... at least until someone discovers a vulnerability in some part of Windows that may just allow such scripts to punch through.

By the way, the Windows Firewall has its own object model, and is fully scriptable. We intend to document this as fully as we can by the time Service Pack 2 is officially released. In the meantime, here are a couple scripts you can play around with. Over the next week or so, I'll pop a few additional scripts into the blog, just to give you a better idea of what (and how) you'll be able to manage the firewall after you upgrade all your XP machines to Service Pack 2.

As I noted before, the Windows Firewall is enabled by default when you install Service Pack 2. For most people that's a good thing; if you already have a firewall running on your machine, however, you might not want to have Windows Firewall running as well. So how can you disable Windows Firewall? Why, by running this script, of course:

Set objFirewall = CreateObject("HNetCfg.FwMgr")
Set objPolicy = objFirewall.LocalPolicy.CurrentProfile

objPolicy.FirewallEnabled = FALSE

Related Reading