本帖最后由 pcl_test 于 2015-3-18 14:11 编辑
回复 2# qq544935474 - @echo off
- setlocal enabledelayedexpansion
- for /f "delims=" %%a in ('dir /b *.jpg') do (
- set wtime=%%~ta
- set wtime=!wtime:~,4!!wtime:~5,2!!wtime:~8,2!
- set k=0
- set t=1000
- for /f "delims=" %%b in ('dir /b "!wtime!*.jpg" 2^>nul') do set /a k+=1
- set /a r=!t!+!k!
- set r=_!r:~-3!
- if !wtime! == !temp! (
- ren "%%a" "!wtime!!r!.jpg"
- ) else (
- set temp=!wtime!
- if !k! ==0 (ren "%%a" "!wtime!.jpg") else (ren "%%a" "!wtime!!r!.jpg")
- )
- )
- pause
复制代码
|