Simply put, my question is the same as this but for Windows 7 Ultimate 64-bit.

Note that I want to copy only files of a specific file type, and that I must preserve the directory structure and names. In other words, I want to do the same as copying a folder and its subfolders (e.g. I want to copy foo/myfolder to moo/myfolder), but leave out all the files except those of a specific file type (e.g. .txt files).

Hope my question is clear enough, and that this is possible!

xcopy /s foo\myfolder\*.txt moo\myfolder
  • Thanks! Didn't try it till now, but works like a charm. I made a .bat file out of it so I don't have to type it each time. – puggsoy Jun 7 '12 at 20:43
  • How do you know when this is done? Does the blinking cursor come up again? – Celeritas Jun 11 '12 at 18:24
  • Well, if you put it into a batch file it'll open in a console window, list all the files that it's copying, then close when it's done.If you're just typing it in straight from the console, I'd guess that it also lists the files that it's copying, then when it's done it'll stop and the blinking cursor will return. – puggsoy Jun 13 '12 at 20:13
  • +1 you are a savior, where do u guys learn these stuff? – Mohammed Joraid Aug 16 '14 at 6:03
  • So much is forgotten, so much is lost :( – Avi Sep 6 '18 at 17:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.