一切福田,不離方寸,從心而覓,感無不通。

禁用tcp/ip筛选功能的vbs脚本

On Error Resume Next  

strComputer = "."  

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

Set colNicConfig = objWMIService.ExecQuery  ("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")  

 

For Each objNicConfig in colNicConfig  

 If objNicConfig.IPFilterSecurityEnabled Then  

   intDisableReturn = objNicConfig.DisableIPSec  

   If intDisableReturn = 0 Then  

     WScript.Echo "ip过滤已禁用."  

   ElseIf intDisableReturn = 1 Then  

     WScript.Echo "ip过滤已禁用." &        VbCrLf & " 必须重新启动使更改生效."  

   Else  

     WScript.Echo "无法禁用ip过滤"  

   End If  

 Else  

   WScript.Echo "ip过滤已经是禁用的."  

 End If  

Next