- @echo off
- setlocal EnableDelayedExpansion
- pushd "%~dp0"
- for /f "delims=" %%I in ('dir /a-d /b /s "*(*.jpg"^|findstr /ire "([0-9][0-9]*)\.jpg"') do (
- for /f "tokens=1,2,* delims=()" %%A in ("%%I") do (
- set num=00%%B
- set num=!num:~-2!
- if not "!num!"=="%%B" (
- echo.move "%%I" to "%%A(!num!)%%C"
- move "%%I" "%%A(!num!)%%C"
- )
- )
- )
- popd
- endlocal
- pause
- exit /b
复制代码
|