0

我将文件从源复制到目标的代码是

set "source=C:\Documents and Settings\My Documents\msword"
set "dest=D:\Test"

pushd "%source%" ||(
   echo.Source does not exist&pause&goto EOF)

for /f "tokens=*" %%f in (
   'dir /A-D /OD /B') Do set "file=%%f"

popd

xcopy /s /d /e "%source%\%file%" "%dest%\" 

我想编写脚本,将当前日期创建的文件和同一天更新的任何先前文件复制到其他驱动器文件夹,包括具有相同的目录结构。但它应该只存储当前日期和更新文件......

4

1 回答 1

0

使用robocopy而不是 xcopy。

请参阅http://technet.microsoft.com/en-us/library/cc733145(v=ws.10).aspx

然后试试这个

 robocopy  "C:\Documents and Settings\My Documents\msword" "D:\words" /maxage:1
于 2013-01-15T11:30:37.547 回答