自动从文件夹和子文件夹复制文件 [英] Copy Files From Folders and SubFolders Automatically
问题描述
如何将所有* .mp3文件从所有文件夹和子文件夹复制到另一个文件夹?我还希望它自动覆盖具有相同名称的任何现有文件,而不会提示您进行确认.我不想复制文件夹结构.我只想将所有* .mp3文件转储到一个文件夹中.
How would I go about copying all *.mp3 files from all folders and subfolder to another folder? I would also want this to automatically overwrite any existing file with the same name without being prompted for comfirmation. I don't want to copy the folder structure. I just want to dump all the *.mp3 files into one folder.
我会使用类似 xcopy/y * .mp3 g:\ MyOldFolder g:\ MyNewFolder
的东西吗?
Would I use something like xcopy /y *.mp3 g:\MyOldFolder g:\MyNewFolder
?
推荐答案
测试此批处理文件-确保 d:\ target
已经存在.
Test this batch file - make sure that d:\target
exists already.
@echo off
for /r "c:\base\folder" %%a in (*.mp3) do copy /y "%%a" "d:\target"
要在cmd提示符下使用,请将每个位置的 %%
减少为单个%
For use at the cmd prompt reduce the %%
in each spot to a single %
这篇关于自动从文件夹和子文件夹复制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!