How to copy specific file types from one folder into another folder

≡放荡痞女 提交于 2019-12-13 14:49:50

问题


How do you copy specific file types from one folder into another folder while retaining the folder structure?

The following batch command is capable of copying the specific file types to a folder, but lacks being able to retain the folder structure:

for /R c:\source %%f in (*.cpp,*.h) do copy %%f x:\destination\

How could I modify this to keep the folder structure from the source? Thanks!


回答1:


xcopy /e c:\source\*.xml x:\destination\

should do the job.

See

xcopy /?

from the prompt for documentation. Use /e for with-empty-directories or /s for to ignore empty directories.



来源:https://stackoverflow.com/questions/15753420/how-to-copy-specific-file-types-from-one-folder-into-another-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!