求助:文件批量该名,包含子文件夹
bat吧
全部回复
仅看楼主
level 1
jujun 楼主
我有很多个文件夹,每个文件夹里面有很多图片,现在想把每个文件夹内的文件都用数字按顺序命名,即A文件夹里面的文件是1.JPG,2.JPG,3.JPG。B文件夹里面文件是也是1.JPG,2.JPG,3.JPG
我这里有个批处理,但是只能处理当前文件夹下的文件,不能修改子文件夹的
@echo off
setlocal enabledelayedexpansion
set /a aa=1
for %%1 in (.\*.jpg) do (ren "%%1" !aa!.jpg&set /a aa=!aa!+1)
pause
2015年10月22日 08点10分 1
level 14
@echo off
setlocal enabledelayedexpansion
set /a aa=1
for /f "delims=" %%1 in ('dir /a-d /b /s *.jpg') do (ren "%%1" !aa!.jpg&set /a aa=!aa!+1)
pause
2015年10月24日 05点10分 2
1