- @echo off
- set n=0
- setlocal enabledelayedexpansion
- for /f "tokens=1* delims=:" %%a in ('findstr /n .* 1.txt') do (
- set "str=%%b"
- if "!str:~,2!"=="[#" (
- set "str1=%%~nb"
- if not exist "%HOMEPATH%\Desktop\!str1:~,-1!.jpg" echo,%%a:不存在文件!str1:~,-1!.jpg!>>b.txt
- set /a n+=1
- ) else (
- if not !n!==0 if not !n!==6 echo,第%%a行上面一组有!n!行组成!>>a.txt
- set n=0
- )
- )
- pause
复制代码 批处理文件和1.txt放在同一个目录。 |