Hi all. I'm trying to create a .bat file, which will search for a specific file type in a tree(hundreds of folders), and copy all those to a folder named with current date(which will need to be created). Any ideas on how I should do?

I have done a lot of similar functions in OpenVMS, but I don't know how to do it in Windows...

11 Years
Discussion Span
Last Post by Ironbid

Sounds good. Countdown begins now..... Just paste the code into a reply in the thread.

Seems like this is something everyone should know, but I seem to develop somekind of allergic reaction when working with Windows...


hmmm, I couldn't actually think of a way to do that with batch files.

The best I could come up with was:-

xcopy /s c:\stuff\*.txt c:\tempFolder

Which would copy all the .txt files from the folder stuff (and all its sub-folders) into the folder tempFolder.

However, it also copies the tree structures as well. Maybe I'm missing something.


I mean, I could code something with the windows API to recurse through your directories and do exactly what you want but it's a little more effort.


Alright. But it seems like I solved though.

I managed to create a folder with todays date, and make a recursive search through my folders, copying only the files with the latest changes with the /d: swith, or make a complete backup through an exellent user-interface.

All thanks to the nice help in cmd....

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.