-
- @echo off&set cd=%cd%
- for /f "delims=" %%i in ('dir/b/s *.jpg') do (
- if exist "%%i" (
- if exist "%%~dpixbs.jpg" (
- cd/d %%~dpi
- set /a n=0
- for /f "delims=" %%j in ('dir/b *.jpg') do (
- set var=%%~nxj&set /a n+=1
- setlocal enabledelayedexpansion
- if not "!var!"=="xbs.jpg" (
- ren "!var!" "xbs!n!.jpg"
- ) else (set /a n-=1)
- for %%k in (!n!) do endlocal&set n=%%k
- )
- cd/d %cd%
- ) else (ren "%%i" "xbs.jpg")
- )
- )
- pause
复制代码
|