batch-file - 排除功能不适用于 xcopy
问题描述
这是我的命令
排除功能不适用于 xcopy
@Echo Off
set source=C:\Users\garang\Documents\input_files2\Advisory_Rate
set destination=C:\Users\garang\Documents\input_files2\Advisory_Rate\Archive
xcopy "C:\Users\garang\Documents\input_files2\Advisory_Rate" "C:\Users\garang\Documents\input_files2\Advisory_Rate\Archive" /S /C /Y /EXCLUDE:"C:\Users\garang\Documents\input_files2\Advisory_Rate\Advisory Rate mapping.xlsx"
错误:
C:\Users\garang\Documents\input_files2\Advisory_Rate>movefiles
Can't read file: "C:\Users\garang\Documents\input_files2\Advisory_Rate\Advisory Rate mapping.xlsx"
0 File(s) copied
C:\Users\garang\Documents\input_files2\Advisory_Rate>
这是参考问题,我已经放弃了这个问题。
解决方案
RoboCopy
也可以移动文件和目录!!
如果您在该特定树中只有一个目录Archive
,您可能会使用它:
@CD /D "%UserProfile%\Documents\input_files2\Advisory_Rate" 2>Nul || Exit /B
@RoboCopy . Archive /S /Move /XD "Archive" /XF "Advisory Rate mapping.xlsx" "Quick_OPU_listing.xlsx" 2>Nul
推荐阅读
- android - Android Jwplayer:发出非法状态异常
- c++ - 为什么 TinyXML2 的 XMLDocument::FirstChild() 函数在尝试解析这个有效的 XML 文件时返回 NULL?
- python - Python在子进程退出时执行函数
- ios - 消耗品 IAP 偶尔不会提供奖励,并且消耗品促销代码根本不起作用
- saml - Keycloak“处理身份提供者的身份验证请求时出现意外错误”
- r - 如何通过将列与另一个 data.frame 中的列进行比较来从 data.frame 创建子集?
- bash - 如何使用 bash 变量来保存 find 的 printf 语句的格式
- performance - Web Assembly (Wasm),垃圾回收
- python - 保存从数组中删除的数字的位置
- javascript - Google Assistant 在 Dialogflow webhook 中验证用户输入