file - 使用命令行移动特定名称的所有文件
问题描述
我要做的是使用命令行将仅具有特定名称的文件夹从子目录移动到新位置(例如 from C:\users\me\desktop\animals
to )。C:\users\me\desktop\folder2
例如:
本质上,假设我有一个 Animals 文件夹,其中包含三个子文件夹:Birds
、Mammals
和Reptiles
如下:
Animals
Birds
Breathe
more subdirectories
Feathers
more subdirectories
Mammals
Fur
more subdirectories
Breathe
more subdirectories
Reptiles:
Breathe
more subdirectories
Scales
more subdirectories
我想从、、 AND复制Breathe
文件夹及其子目录(它们都在 Animals 文件夹中)。我怎样才能做到这一点?Mammals
Reptiles
birds
到目前为止,我已经能够遍历文件
for /f %f in ('dir /b C:\users\me\desktop\folder1') do move "breathe"
但这只会返回此错误 3 次:
The system cannot find the file specified
我明白为什么,但我怎样才能解决这个问题,让它真正进入每个文件夹并复制我关心的内容?
解决方案
推荐阅读
- r - 根据最后一个已知值扩展数据框
- c# - Azure ServiceBusConnectionStringBuilder 中的“实体路径”是什么?
- javascript - Google Cloud Functions:尝试使用 ES6 时部署失败
- c# - Xamarin 表单反序列化 Json 不工作
- python - 在 SQLAlchemy 中有效地找到没有孩子的父母
- visual-studio-2019 - Microsoft Visual Studio 扩展 (VSIX) 小写 $safeprojectname$
- ruby-on-rails - Rails - 地理编码器安装问题
- ios - APPSTORE:无法提交应用以供审核。启动审核过程需要以下项目: 发生错误。稍后再试
- ruby-on-rails - rails g 模型或 rails g 脚手架不创建模型
- javascript - ng2-tooltip-directive 在 mousemove 事件上隐藏工具提示