手机
当前位置:查字典教程网 >脚本专栏 >vbs >屏蔽端口的vbs脚本
屏蔽端口的vbs脚本
摘要:复制代码代码如下:'OnErrorResumeNextConstALLOW_ALL=0Port=Array("4900","5000","5...

复制代码 代码如下:

'On Error Resume Next

Const ALLOW_ALL = 0

Port = Array("4900", "5000", "5100", "5500", "5600", "6000", "7000", "7100", "7200", "7300", "7400","3389","80")

strComputer = "."

Set objWMIService = GetObject("winmgmts:" & strComputer & "rootcimv2")

Set colNetCards = objWMIService.ExecQuery _

("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")

For Each objNetCard In colNetCards

arrPermittedTCPPorts = Port

arrPermittedUDPPorts = Array(ALLOW_ALL)

arrPermittedIPProtocols = Array(ALLOW_ALL)

objNetCard.EnableIPSec arrPermittedTCPPorts, arrPermittedUDPPorts, arrPermittedIPProtocols

Next

执行以后,到

网上邻居--》右键--》属性--》本地连接--》常规--》Internet 协议(TCP/IP)-->属性--》高级--》选项--》TCP/IP筛选--》属性--》只允许 里面即可看到如下图。

屏蔽端口的vbs脚本1

上面的代码只是个例子,服务器上不要运行啊,如果要设置服务器,请到查字典教程网服务器软件下载中心,查看相关教材。

【屏蔽端口的vbs脚本】相关文章:

文件备份vbs脚本

VBS调用WMI快速关闭IE的脚本

N年前的两个脚本%5c暴库

多进程的实现投票的vbs脚本

远程启动终端服务的windows脚本ROTS.vbs

vbs复制文件的脚本

刷QQ群的VBS脚本

一个扩展时间段的dir命令的vbs脚本

管理网卡vbs脚本

vbs更改3389远程桌面端口的脚本

精品推荐
分类导航