多目录下所有文件按创建时间重命名.bat

@echo off&title %~n0 - [email protected]

setlocal EnableDelayedExpansion
set d=1000

for %%a in (%*) do (
  if exist %%a (
    cd /d %%a
    for %%b in (*) do (
      if not "%%b"=="%~n0.bat" (
        set /a d+=1
        set c=%%~tb
        set c=!c:~0,4!!c:~5,2!!c:~8,2!!c:~11,2!!c:~14,2!
        ren "%%b" "!c!!d!a2.*"
      )
    )
  )
)

你可能感兴趣的:(Bat)