可处理空格- @echo off&setlocal enabledelayedexpansion
- set /p path1=输入A文件夹:
- set /p path2=输入B文件夹:
- for /L %%i in (1,1,100) do set "t=!t!0!"
- cd /d "%path1%\"
- for %%i in (*.*) do (
- if exist "%path2%\%%~nxi" (
- for %%j in ("%path2%\%%~nxi") do (
- set "az=!t!%%~zi"
- set "bz=!t!%%~zj"
- if "!az:~-100!" gtr "!bz:~-100!" copy "%%i" "%path2%"
- )
- )
- )
- pause
复制代码
|