I need (preferrably a batch file) a program that will copy all declared file types (in this project, all image types) from a directory of subfolders to a new folder while maintaining the tree.

C:\files\baseA\sub1\img.jpg
C:\files\baseA\sub1\file.txt
C:\files\baseA\sub2\img.jpg
C:\files\baseA\sub2\file.txt
C:\files\baseB\img.jpg
C:\files\baseB\file.txt

to

C:\tmp\baseA\sub1\img.jpg
C:\tmp\baseA\sub2\img.jpg
C:\tmp\baseB\img.jpg

Any recommendations? Or maybe you have a snippet of code that does similar that i can strip and rebuild?
Use xcopy, the very first result for for "windows copy recursive" on Google.
I know how to copy directories, subtress, and empty subtress... I need to selectively copy ONLY images...
Second Google result for "windows recursively copy files of a single type" looks like it should do the trick for you. Smile

Code:
XCOPY /s *.jpg E:\ftp\backup\
seems to have worked marvelously. Thanks Kerm, though I wish you could have just pasted your findings XD
But then he wouldn't be teaching you a lesson about looking stuff up on your own, which is the point he was making by saying it was google results. There's no point in starting a topic and waiting for answers when a quick google search will give you what you need.
merthsoft wrote:
But then he wouldn't be teaching you a lesson about looking stuff up on your own, which is the point he was making by saying it was google results. There's no point in starting a topic and waiting for answers when a quick google search will give you what you need.
This indeed. We love answering complex code questions and guiding you to find particularly hard-to-find answers, but when it's something obvious, it feels like you're just asking us to do the two minutes of Googling for you. And when that happens, we feel disgruntled.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement