本帖最后由 77七 于 2022-12-11 02:07 编辑
- @echo off
- cd /d "%~dp0"
- md "横向文件夹\"
- md "方形文件夹\"
- md "纵向文件夹\"
- for %%i in (*.jpg *.png *.bmp) do (
- setlocal enabledelayedexpansion
- for /f "tokens=2 delims=^=" %%a in ('ffprobe -show_frames "%%i" 2^>^&1 ^| find "width="') do ( set "w=%%a" )
- for /f "tokens=2 delims=^=" %%a in ('ffprobe -show_frames "%%i" 2^>^&1 ^| find "height="') do ( set "h=%%a" )
- if "!w!" gtr "!h!" move /y "%%i" "横向文件夹\."
- if "!w!" equ "!h!" move /y "%%i" "方形文件夹\."
- if "!w!" lss "!h!" move /y "%%i" "纵向文件夹\."
- endlocal
- )
- pause
复制代码
需要 用到ffprobe 添加到系统变量
保存为ansi格式,和图片放在一起
不会写,效率有点低... |