本帖最后由 WHY 于 2017-12-15 20:42 编辑
- @echo off
- setlocal enabledelayedexpansion
- for /f "delims=" %%i in ('dir /b /a-d /s D:\123\*.jpg ^| findstr /i "D:\\123\\[^\\]*\\[^\\]*\\[^\\]*$"') do (
- if not "!s!" == "%%~dpi" (
- set n=1
- if defined s echo; rd /s /q "!s!"
- ) else (set /a n+=1)
- for %%j in ("%%~dpi.") do echo;move "%%i" "%%~fj(!n!)%%~xi"
- set "s=%%~dpi"
- )
- if defined s echo; rd /s /q "!s!"
- pause
复制代码
|