批量修改文件名(设置顺序)
for %%n in (*.jpg)
新建txt文件,复制下边的代码
@echo off
set a=1
setlocal EnableDelayedExpansion
for %%n in (*.jpg) do (
set /A a+=1
ren "%%n" "前缀!a!.jpg"
)
注释:
a——起始值
setlocal EnableDelayedExpansion——设置同级目录文件
for %%n in (*.jpg)——遍历后缀为jpg的文件
"前缀!a!.jpg"——组成:前缀名、下标、文件类型