I have a network fileshare called
which contains hundreds of sub-directories named
MSDS plus a number).
Inside each sub-directory MAY be numerous files —
.jpg and various
which contains old FrontPage extensions associated with meta-data.
But there should always be at least one file within these sub-directories
with the name format
(The number may be varying lengths;
There may also be old, outdated versions of these files which the owner appended an
X#_ in front of the file (see the red box in the image — there are two archival versions of the
MSDS0001.PDF file in this example).
Here's what I need to accomplish: I need to copy all of the current,
top-level PDF files somewhere
(a single directory called
SDS on my
I do NOT want to replicate the sub-folders,
and I only want the files with the
(These files are highlighted in yellow in the above image.)
So I want to exclude:
- files in sub-directories under
MSDSnnnndirectories (e.g., in
- files whose names don't begin with
- files whose names don't end with
I tired the following command in Robocopy:
robocopy \\smweb\msds\ H:\SDS msds*.pdf /S /R:3 /W:3 /NDL /XJD /XD _vti_cnf
The problem is that Robocopy replicated the folder structure
How can I accomplish my goal?