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%\"
上記のスクリプトは、サブフォルダーのファイルをコピーしていません。何を変更すればよいですか?
現在の作成日ファイルと同じ日に更新された以前のファイルを、同じディレクトリ構造を含む別のドライブ フォルダーにコピーするスクリプトを作成したいと考えています。しかし、現在の日付と更新ファイルのみを保存する必要があります……
更新されたスクリプト (@BaliC の要求による)
set "source=C:\Documents and Settings\kalim\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 (
xcopy /s /d /e "%source%\" "%dest%\"
)