1

我使用 XCopy 和排除列表,看起来像

.cs\
\日志\

和 XCopy 命令

SET exludedPaths=%cd%\Settings\excluded_pa
​​ths.txt SET projectDir=%cd%\MyFolder
SET outputDir=%cd%\Drops\
XCOPY /S %projectDir% %outputDir%\ /EXCLUDE:%exludedPaths%

一切正常,但我想忽略另一个目录中的 xml 文件(只有 xml 文件),像这样

.cs\
\Log\
\anotherdirectory\*.xml <-它不起作用。

我如何指定排除列表中的最后一行,或者这是不可能的?

4

1 回答 1

0

Yep.Exclude does not support wildcards.

pushd cs\log\anotherdirectory
for /f %%f in (dir /b *.xml) do (
   echo %%~ff >> %exludedPaths%
)
popd

this should list all files in anotherdirectory into the excluded list

于 2012-11-29T21:30:51.393 回答