赞
踩
@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
)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。