晕啊,88次浏览还没一个回复,这年头都不是新手了啊,呵呵,那我这个新手来抛砖引玉,顶一顶吧。- @echo off
- setlocal enabledelayedexpansion
- :repeat
- set /a n=0,count+=1
- for /f "delims=" %%a in ('dir /a-d /s/b *.inf 2^>nul^|^|echo Alert') do (
- if "%%a"=="Alert" goto :eof
- set /a n+=1
- call :show "%%a"
- if !n! equ 4 goto :eof
- )
- if %count% lss 4 goto repeat
- :show
- for /f "delims=" %%b in ('type %1') do echo %~1第一行为%%b>>c.txt&goto :eof
复制代码
|