
- 帖子
- 193
- 积分
- 398
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2008-12-19
|
本帖最后由 wh123wh123 于 2021-7-22 02:53 编辑
回复 28# newswan
能不能把下面代码完善一下,只正对AAA.exe阻断和放行,并且显示正在执行第几次
@echo off
title=恢复默认
netsh advfirewall set domainprofile firewallpolicy blockinbound,AllowOutbound
netsh advfirewall set privateprofile firewallpolicy blockinbound,AllowOutbound
netsh advfirewall set publicprofile firewallpolicy blockinbound,AllowOutbound
pause
@echo off
title=批处理阻止与解除某个exe进程的联网
netsh advfirewall set domainprofile firewallpolicy blockinbound,blockoutbound
netsh advfirewall set privateprofile firewallpolicy blockinbound,blockoutbound
netsh advfirewall set publicprofile firewallpolicy blockinbound,blockoutbound
:loop
ping -n 6 127.0.1 >nul
echo 已断开
netsh advfirewall firewall delete rule name="阻断一次"
ping -n 9 127.0.1 >nul
echo 已连接
netsh advfirewall firewall add rule name="阻断一次" dir=out action=allow program="D:\AAA.exe" enable=yes
goto :loop |
|