bat批量改图片文件名

批量改图片 1-N排序

注:原有排版会乱(还没找到解决方案)

@echo off & setlocal enabledelayedexpansion
echo 一键将本bat所在文件夹内的图片改名为1~N
dir /b *.jpeg >>A.txt
dir /b *.jpg >>B.txt
dir /b *.png >>C.txt
dir /b *.gif >>D.txt
echo 已获取图片文件列表,按任意键开始改名 & pause>nul
 
for /f "delims=" %%a in (A.txt) do (
set /a n+=1
ren "%%a" !n!.jpeg
)
del /f /q A.TXT
 
for /f "delims=" %%a in (B.txt) do (
set /a n+=1
ren "%%a" !n!.jpg
)
del /f /q B.TXT
 
for /f "delims=" %%a in (C.txt) do (
set /a n+=1
ren "%%a" !n!.png
)
del /f /q C.TXT
 
for /f "delims=" %%a in (D.txt) do (
set /a n+=1
ren "%%a" !n!.gif
)
del /f /q D.TXT
echo 处理完毕,按任意键退出 & pause>nul

非原创,个人笔记。勿商用。



@echo off
setlocal EnableDelayedExpansion


set a=1
for /f  "delims=" %%i in ('dir /b *.jpg') do (

ren "%%i" "!a!.jpg"



set /a a+=1
)





你可能感兴趣的:(笔记,其他)