Enable File and Printer Sharing Through Windows Firewall

Enables File and Printer Sharing on a computer running Windows XP Service Pack 2.

VBScript Code


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

Set colServices = objPolicy.Services
Set objService = colServices.Item(0)
objService.Enabled = TRUE