playinthesky 当前离线
三级士官
@echo off for /r %%a in (*-2001-永久-*.jpg) do ( set /a num01+=1 ) for /r %%b in (*-2001-长期-*.jpg) do ( set /a num02+=1 ) echo 2001年永久%num01%件 echo 2001年长期%num02%件 pause复制代码
WHY 当前离线
上校
@echo off set "s=\-19[6-9][0-9]\-永久\-[^\\]*\.jpg \-200[0-9]\-永久\-[^\\]*\.jpg \-201[0-5]\-永久\-[^\\]*\.jpg" for /f %%i in ('dir /b /s /a-d^|findstr /i /e "%s% %s:永久=长期%"^|find /c /v ""') do set "num=%%i" echo %num% pause复制代码
TOP
terse 当前离线
中将
dir /s /b /a-d "*-%%i-永久-*.jpg" |find /v /c "" 复制代码
pcl_test 当前离线
荣誉版主
@echo off for /l %%i in (2001,1,2010) do ( setlocal enabledelayedexpansion for /r %%a in ("*-%%i-永久-*.jpg") do set /a num01+=1 for /r %%b in ("*-%%i-长期-*.jpg") do set /a num02+=1 echo %%i年永久!num01!件 echo %%i年长期!num02!件 endlocal ) pause复制代码
@echo off&setlocal enabledelayedexpansion for /l %%i in (2001,1,2010) do ( for /r %%a in ("*-%%i-永久-*.jpg") do ( set /a num01+=1 ) for /r %%b in ("*-%%i-长期-*.jpg") do ( set /a num02+=1 ) ) echo %i%年永久%num01%件 echo %i%年长期%num02%件 pause复制代码
@echo off for %%i in (*.jpg) do ( for /f "tokens=1-4 delims=-" %%a in ("%%i") do ( for /r %%k in (*-%%b-%%c-*.jpg) do ( set /a num+=1 ) echo %%b年期限%%c有%num%件 ) ) pause复制代码
for /l %%i in (1960,1,2015) do ……复制代码