@echo off
setlocal enabledelayedexpansion
set src_path=D:\Pictures
set dst_path=D:\Pictures\Sorted
for /r "%src_path%" %%f in (*.jpg *.jpeg *.png) do (
set "exif_date="
for /f "skip=1 tokens=1-9" %%a in ('wmic datafile where name^="%%f" get lastmodified /format:list') do (
if not defined exif_date set "exif_date=%%b-%%c-%%d"
)
if defined exif_date (
set "dst_dir=%dst_path%\!exif_date!"
if not exist "!dst_dir!" mkdir "!dst_dir!"
move "%%f" "!dst_dir!"
echo Moved "%%f" to "!dst_dir!"
)
)
goto :eof
直接新建 aa.bat文件 复制进去 点击执行