这样吗?- @echo off&setlocal enabledelayedexpansion
-
- >ok.bat echo ipseccmd -w REG -p "HFUT_SECU" -r "Block ICMP/255" -f *+0:255:ICMP -n BLOCK -x ^>nul
- >>ok.bat echo ipseccmd -w REG -p "HFUT_SECU" -r "Block TCP/43958" -f *+0:43958:TCP -n BLOCK -x ^>nul
-
- for /f "tokens=3" %%a in ('netstat -ao^|findstr "[^0-9]3704$"') do (
- set "str=%%a"
- if "!str:.=!" neq "!str!" (
- for /f %%b in ("!str::= !") do (
- >>ok.bat echo ipseccmd -w REG -p "clxp safe policy" -r "disable connect ip" -f 0/255.255.255.255=%%b/255.255.255.255:: -n BLOCK -x
- )
- )
- )
- pause
复制代码
|