Aaron
asked on
Can Robocopy only copy files with a certain string of characters included in a files name?
Hello,
I'm trying to utilize Robocopy to copy only files that have a certain string of characters included in the file name. For example, say I want to copy all files in folders/subfolders that have the following included in the file name: "post 2019". Examples of files that should be copied would be:
....\investment post 2019 listing.doc
...\accounting post 2019 partA.doc
....\Post 2019 article A.xls
All other files would be excluded. I tried the following command but had no luck getting files in the Source folder with "post 2019" in the file name to copy over:
robocopy "Source" "Destination" *"post 2019" /E /W:1 /R:1 /log:C:\Robocopy\robolog.t xt /np
Does Robocopy have the ability to perform this type of copy? Thanks
I'm trying to utilize Robocopy to copy only files that have a certain string of characters included in the file name. For example, say I want to copy all files in folders/subfolders that have the following included in the file name: "post 2019". Examples of files that should be copied would be:
....\investment post 2019 listing.doc
...\accounting post 2019 partA.doc
....\Post 2019 article A.xls
All other files would be excluded. I tried the following command but had no luck getting files in the Source folder with "post 2019" in the file name to copy over:
robocopy "Source" "Destination" *"post 2019" /E /W:1 /R:1 /log:C:\Robocopy\robolog.t
Does Robocopy have the ability to perform this type of copy? Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You're welcome... and thanks for the testimonial!
ASKER
Thank you NVIT! After reading your post I went doh! I had forgot the extra wildcard (*) and had the quotes incorrect. I just ran a test and it pulled the needed files correctly. Thank you for the quick response.