本帖最后由 batman 于 2011-5-23 12:49 编辑
改晕了,只能这样了:- @echo off
- @echo off&setlocal enabledelayedexpansion
- for %%a in (*.txt) do (
- set /p ip=<"%%a"
- (echo ipseccmd -w REG -p "plocy" -r "permit list" -f !ip!/255.255.255.255:*+0/255.255.255.255:5001:tcp -n PASS -x
- echo ipseccmd -w REG -p "plocy" -r "permit list" -f !ip!/255.255.255.255:*+0/255.255.255.255:5002:tcp -n PASS -x
- echo ipseccmd -w REG -p "plocy" -r "permit list" -f !ip!/255.255.255.255:*+0/255.255.255.255:5003:tcp -n PASS -x
- echo ipseccmd -w REG -p "plocy" -r "permit list" -f !ip!/255.255.255.255:*+0/255.255.255.255:5109:tcp -n PASS -x
- echo del /q ^%%0)>"%%a"
- ren "%%a" "%%~na.bat"
- )
- for %%a in (*.bat) do (
- if "%%~na" neq "%%~n0" "%%a"
- ping /n 2 127.1>nul
- )
复制代码
|