[ Last edited by yaoguof on 2006-12-1 at 01:46 AM ]作者: reddragonfly 时间: 2006-12-1 14:00 拷贝文件夹的话只需要在xcopy命令后面加参数/s /e就可以了,经测试可行,内容如下:
@echo off
cls
dir /a /b d:\log1>>1.txt
dir /a /b d:\log2>>2.txt
for /f "tokens=*" %%i in (1.txt) do (
findstr /i "%%i" d:\2.txt
if errorlevel 1 xcopy /s /e d:\log1\"%%i" d:\log2&echo 拷贝成功
)
del 1.txt;2.txt
pause 1>nul&goto :eof