- @echo off & setlocal enabledelayedexpansion
- set "srcDir=F:\A"
- set "dstDir=F:\B"
- set "s=00000000000000000000"
- pushd "%srcDir%\"
- for /f "delims=" %%a in ('dir /a-d /b') do (
- if exist "%dstDir%\%%a" (
- set "sz1=!s!%%~za"
- for %%b in ("%dstDir%\%%a") do set "sz2=!s!%%~zb"
- if "!sz1:~-20!" lss "!sz2:~-20!" move "%%a" "%dstDir%\"
- ) else move "%%a" "%dstDir%\"
- )
- pause
复制代码
|