标题: 能否帮忙转换下批下理?IP策略
[打印本页]
作者: wotlitn
时间: 2010-5-12 19:28
标题: 能否帮忙转换下批下理?IP策略
以下代码是在2003,XP上用的...前两天换成WIN7后发现ipse的命令变了,看了三天,也只会一个一个加..请帮忙转换一下以下代码成WIN7的netsh ipsec,感谢
@echo off
ipseccmd -w reg -p Block -y
ipseccmd -w reg -p Block -o
set "a=0"
set "b="
set "list="
FOR /f "skip=1 delims= " %%i IN (D:\禁止IP列表.txt) DO call :_ipsec "%%i"
if %a% leq 386 ipseccmd -w reg -p Block:1 -r filterlist%b% -f %list% -n BLOCK
ipseccmd -w reg -p Block -x
goto _next
:_ipsec
set /a a+=1
set list=%list% %~1
if %a% gtr 386 (
ipseccmd -w reg -p Block:1 -r filterlist%b% -f %list% -n BLOCK
set "list="
set "a=0"
set /a b+=1
)
goto :eof
:_next