本帖最后由 flashercs 于 2019-9-5 02:19 编辑
处理所有子目录的图片ren.bat- @echo off
- setlocal EnableDelayedExpansion
- pushd "%~dp0"
- for /r . /d %%A in (*) do (
- pushd "%%A"
- set /a ctr=0,left=0,right=0
- set file1=
- set file2=
- for /f "delims=" %%B in ('2^>nul,where ".:*.jpg"') do (
- set /a ctr+=1
- if !ctr! equ 1 (
- ren "%%B" "机台照.jpg"
- ) else (
- set /a left=right,right=left+5
- ren "%%B" "!left!-!right!m.jpg"
- set file1=!file2!
- set file2="!left!-!right!m.jpg"
- )
- )
- ren !file1! "全景照.jpg"
- ren !file2! "喷漆照.jpg"
- popd
- )
- popd
- endlocal
- pause
- exit /b
复制代码
|