原样复制过来
@echo off
set src=D:\Data
set dest=D:\Data2
cd /d %src%
for /f "tokens=*" %%i in (‘dir /B %src%‘) do (
echo %notCopy%|findstr "%%i">nul||(echo %%~ai|findstr "d">nul && xcopy %%~fi\* %dest%\%%~ni\ /E /Y || xcopy %%~fi %dest%\ /S /Y)
)
把所有文件放到一个文件目录下
@echo off
set src=D:\smt
set dest=D:\smt2
cd /d %src%
xcopy *.* %dest%\
for /f "tokens=*" %%i in (‘dir /B %src%‘) do (
echo %notCopy%|findstr "%%i">nul||(echo %%~ai|findstr "d">nul && xcopy %%~fi %dest%\ /S /Y)
)