首页 > 技术文章 > firewall

final233 2019-06-04 09:52 原文

firewall

使用 netsh advfirewall 屏蔽某程序访问网络

;关闭防火墙
nsExec::Exec 'cmd /c netsh advfirewall set allprofiles state off'
;开启防火墙
nsExec::Exec 'cmd /c netsh advfirewall set allprofiles state on'
;删除屏蔽
nsExec::Exec 'cmd /c netsh advfirewall firewall Delete rule name="TIM"'
;添加屏蔽
nsExec::Exec 'cmd /c netsh advfirewall firewall add rule name="TIM" dir=out action=block program="C:\Program Files\TIM Lite\Bin\TIM.exe"'

推荐阅读