@echo off echo>image_stat.txt for /f "tokens=1,2,4" %%i in ('dir /s /t:c *.jpg') do ( echo %%k %%i %%j:>image_stat.txt )