• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 279
  • Last Modified:

robocopy switches

What switches would I use if I wanted to copy everything but want to skip any file that ends in "f.jpg" or "o.jpg"?
0
hrolsons
Asked:
hrolsons
1 Solution
 
becraigCommented:
Robocopy source destination /XF  *f.jpg
0
 
Joe Winograd, EE MVE 2015&2016DeveloperCommented:
Where do things stand on your other similar question?
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/Windows_7/Q_28345765.html

Just as I explained /xc /xn /xo in that question, there's also /xf:

/XF file [file]... :: eXclude Files matching given names/paths/wildcards

The /xf allows multiple file specs, so the answer is:

robocopy c:\sourcefolder e:\destfolder /xf *f.jpg *o.jpg

Of course, the source and destination are whatever folders you want them to be. And as I pointed out yesterday, /s includes non-empty subfolders and /e includes all subfolders, including empty ones. Btw, in yesterday's question, I attached the full Robocopy syntax for you in a file called <robocopy-help.txt>. Regards, Joe

P.S. The first answer above was almost right but it is missing the *o.jpg file spec.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now