- @echo off&setlocal enabledelayedexpansion
- title 任意键中断
- if "%1"=="::" goto ping
- start /b "" %0 ::
- for %%a in (*.txt) do (
- set /p ip=<"%%a"
- (echo @echo off
- for %%b in (5001 5002 5003 5109) do (
- echo ipseccmd -w REG -p "plocy" -r "permit list" -f !ip!/255.255.255.255:*+0/255.255.255.255:%%b:tcp -n PASS -x
- )
- echo del /f %%0)>"%%a"
- ren "%%a" "%%~na.bat"
- )
- pause>nul
- taskkill /f /t /fi "windowtitle eq 任意键中断" /im cmd.exe
- taskkill /f /t /fi "windowtitle eq 管理员: 任意键中断" /im cmd.exe
-
- :ping
- for %%a in (*.bat) do (
- ping /n 2 127.1>nul
- if "%%~na" neq "%~n0" call "%%a"
- )
- exit
复制代码
|