我是靠谱客的博主 复杂雪糕,这篇文章主要介绍屏蔽端口的vbs脚本,现在分享给大家,希望可以做个参考。

复制代码 代码如下:
复制代码

'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 & "\root\cimv2")
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脚本的全部内容,更多相关屏蔽端口内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(170)

评论列表共有 0 条评论

立即
投稿
返回
顶部