Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

How to use Robocopy all files of a given files extension from all folders of a drive to a designated folder of another drive.

$
0
0

I have files of identical filenames and file extensions (say *.txt) created in different folders in a drive, and I need to extract only the latest version of all these files from those folders and put them into a single folder in another drive. I can use robocopy to copy all latest files to an identical hierachy of folders on the destination drive, but not a single folder I wanted, by typing following on the command line

Robocopy c:\txt  d:\txt /xo

What I wanted is to copy all *.txt files from all subfolders in say Drive C: to a single folder on drive D: say d:\txt.  In other words, I would like to see any subfolders created at D:\txt at all.  What I wanted is only files with the latest date marks on them.

I will be grateful if someone would suggest a bat file that could use robocopy to achieve what I wanted.

Regards

Matehk Marco


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>