dos批处理重命名如何按顺序排序

2024-11-25 02:29:22
推荐回答(2个)
回答1:

@echo off
setlocal enabledelayedexpansion
set n=10000
for /f "delims=" %%a in ('dir/b *.jpg') do (
set /a n+=1
ren "%%a" "!n:~-4!.jpg"
)
pause

放到要处理的目录下运行..~!

回答2:

FOR /F "tokens=1* delims=-" %%i IN ('DIR /b /a-d *-*.jpg') DO REN "%%i-%%j" "%%i.jpg"