繁体   English   中英

如何为xcopy创建与文件名的扩展名匹配的排除文件条目?

[英]How to create an exclude file entry for xcopy that matches the extension of a file name?

考虑以下批处理语句:

for / %f in (C:\temp\cool\*) do if not "%~nf" == "update" 
    xcopy /r /Y /S /D:01-01-2001 /EXCLUDE:excl.txt %f c:\temp\%~nf\

它使用带有排除列表的文件。 excl.txt看起来像:

.config
.log

应该跳过所有文件的日志和配置文件。 不幸的是,它也跳过了这个文件:

cfw.loginpopup.js

我该如何解决这个问题? 我只想排除以.log 结尾的文件。

也许我想的太简单了,但是您可以尝试使用此排除列表:

*.config 
*.log

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM