Disable Windows Firewall with VBS/Batch script

Bookmark and Share
This is a simple VBS script to disable the specified computers' windows firewall using WMI, requires administrator access.


strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colServiceList = objWMIService.ExecQuery _
("Select * from Win32_Service where Name = 'SharedAccess'")

For Each objService in colServiceList
If objService.State = "Running" Then
objService.StopService()
Wscript.Sleep 5000
End If
errReturnCode = objService.ChangeStartMode("Disabled")
Next

And if you can do it in VBS, you can do it in batch script!

{ 1 comments... Views All / Post Comment! }

Muhammad Bayu Kurniawan said...

bg ini ngilang firewall di komputer ndiri yah ?

Post a Comment