假设顶楼"例子"的内容已保存为a.txt- @echo off
- psec static add policy name=XBLUE
- netsh ipsec static add filterlist name=denyip
- for /f "eol=# tokens=3,4" %%a in (a.txt) do (
- if %%b gtr 10000 if not defined _%%a (
- netsh ipsec static add filter filterlist=denyip srcaddr=%%a dstaddr=Me dstport=80 protocol=TCP
- set "_%%a=1"
- )
- )
- netsh ipsec static add filteraction name=denyact action=block
- netsh ipsec static add rule name=kill3389 policy=XBLUE filterlist=denyip filteraction=denyact
- netsh ipsec static set policy name=XBLUE assign=y
- pause
复制代码 试试看吧 |