开发者

Recursively copy files that match a wildcard combination but not create the directory tree in DOS

开发者 https://www.devze.com 2023-04-05 19:43 出处:网络
I found that I ca开发者_Go百科n use xcopy /s to copy all files that match a wildcard combination in a folder to another location. But this command re-creates the folder structure. I do not want the tr

I found that I ca开发者_Go百科n use xcopy /s to copy all files that match a wildcard combination in a folder to another location. But this command re-creates the folder structure. I do not want the tree. I need just the files dumped into the destination folder. There are no duplicate files in the source folder.


You can use for command:

for /R %%x in (*.cpp) do copy "%%x" "c:\dest\"

If you want to run it directly from command prompt (not from a batch file) use %x instead of %%x.


For your purpose, instead of using xcopy you should use robocopy:

http://en.wikipedia.org/wiki/Robocopy

http://technet.microsoft.com/en-us/library/cc733145(WS.10).aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消