- @echo off & setlocal enabledelayedexpansion
-
- for /f "delims=" %%i in ('more +18 "%~f0"') do set "#%%i=1"
- set "#%~nx0=1"
- for /l %%a in () do (
- for /f "delims=" %%i in ('dir /b /a-d') do (
- if "!#%%i!"=="" set exec=1
- )
- if defined exec (
- echo;执行某个程序...
- set "exec="
- )
- ping -n 5 127.1 >nul
- )
-
- pause & exit /b
-
-
- 1.txt
- 2.txt
复制代码
|