本帖最后由 batman 于 2011-5-27 16:32 编辑
- @echo off&setlocal enabledelayedexpansion
- set "fpath=这里换成那个文件夹的绝对路径"
- :lp
- for /r %fpath% %%a in (*.txt) do (
- set "ip="&set /p ip=<"%%a"
- if defined ip (
- (for /l %%b in (3386,1,3389) do (
- echo netsh ipsec static add filter filterlist=LST srcaddr=!ip! dstaddr=me description=new protocol=tcp mirrored=yes dstport=%%b
- ))>"%%a"
- ren "%%a" "%%~na.bat"
- start "" "%%~dpna.bat" /wait
- del /f /q "%%~dpna.bat">nul 2>nul
- )
- )
- for /l %%a in (1,1,5) do ping /n 1 127.1>nul
- goto lp
复制代码
|