- @echo off
-
- for /f "delims=" %%a in ('dir /a-d/s/b *.jpg *.png') do (
- set "str=%%~na"
- set /a n+=1
- setlocal enableDelayedExpansion
- set "chs=!str:*vm=!"
- call set sts=%%str:!chs!=%%
- set "new_name=!sts:~,-2! (!n!)%%~xa"
- ren "%%~fa" "!new_name!"
- endlocal
- )
复制代码
|