@echo off&setlocal enabledelayedexpansion for /f "delims=" %%a in ('dir /ad /b ') do ( pushd %%a for %%b in (*.jpg *.png) do ( call :mv "%%~b" ) popd ) goto :eof :mv set n=100 set "name=%~n1" set "ext=%~x1" :loop set /a n+=1 set m=!n:~1! if exist ..!name!!m!!ext! goto :loop echo. name 名字 m 是第几张 ext 是后缀 move "%~1" "..!name!!ext!"
效果图