Would like to automate in a batch file the copying of a set of text files we receive monthly in a new folder on a network drive to another network drive, automatically replacing any existing files there.
Some background: we receive the second week of each month an extract of data files, 14 in total, in a folder labeled with this naming convention, DatabaseFilesyyyymmdd, on one of our shared drives (
\\server1\receptacle). After receipt, another team validates the data, and afterwards informs our team they are ready for loading into an existing Oracle table. We copy the files (not the folder) to another network drive (
\\server2\loading) and kick off the script.
Naturally, that new folder is titled with the same date of the extracted data files. Creating a .bat file we then could launch to automate the copying chore is the goal, but the variability of the new folder names has me stumped in scripting this. Any help appreciated.
Edit: perhaps a way to discover and script the name of the most recently created folder in \receptable is what I'm attempting to figure out in copying the files to another drive.