这样呢?- @echo off&setlocal enabledelayedexpansion
- set d1=F:\share
- set d2=D:\test
- set d3=D:\test2
- set d4=D:\test3
- cd/d "%d1%"
- for /f "delims=" %%i in ('dir/s/b/a')do (
- set "str=%%i"
- if exist "%d2%!str:*%d1%=!" (
- for /f "delims=" %%j in ("%d2%!str:*%d1%=!")do (
- if "%%~ti" neq "%%~tj" copy/y "%d2%!str:*%d1%=!" "%d3%"
- )
- ) else copy "%%i" "%d4%"
- )
- pause
复制代码
|