Using Robocopy with File Sizes and Ages

Written by Barry Dysert (last updated December 11, 2017)

In another tip (Checking the Archive Attribute with Robocopy) we saw that we can have Robocopy perform operations based on file attributes. You can also affect its operation based on file sizes and ages.

For file sizes, you'd use the switches /MAX:n and /MIN:n, where "n" specifies the sizes of the files, in bytes, that are to be excluded from the copy. As an example, specifying /MAX:10000 tells Robocopy to exclude from copying any file that is larger than 10,000 bytes.

You can also alter what is copied based on the files' ages. The following command-line switches are used for this:

  • /MAXAGE:n - Excludes files older than n days (n can also be a date)
  • /MINAGE:n - Excludes files newer than n days (n can also be a date)
  • /MAXLAD:n - Excludes files unused since n date (LAD is an acronym for Last Accessed Date)
  • /MINLAD:n - Excludes files used since n date (LAD is an acronym for Last Accessed Date)

The only trick to using these options is in understanding what the "n" means. Depending upon its value, "n" can either represent days or a date. If "n" is less than 1900 then "n" is assumed to be a number of days, otherwise "n" is a date of this form: YYYYMMDD.

 This tip (13224) applies to Windows 7, 8, and 10.

Author Bio

Barry Dysert

Barry has been a computer professional for over 35 years, working in different positions such as technical team leader, project manager, and software developer. He is currently a software engineer with an emphasis on developing custom applications under Microsoft Windows. When not working with Windows or writing Tips, Barry is an amateur writer. His first non-fiction book is titled "A Chronological Commentary of Revelation." ...


Mapping a Network Drive

You can create a mapping relationship between a network folder and a drive letter so that it's easy to access the folder ...

Discover More

Configuring Automatic Windows Updates

One of the practices you should adopt to keep your system running smoothly is to keep it updated with the latest ...

Discover More

Using Powercfg to Export and Import a Power Scheme

You can export to a file your power schemes and then import them later on. The only caveat is that you must be running as ...

Discover More
More WindowsTips

Searching From within File Explorer

Searching from within File Explorer is a quick and easy way to find files and even content within files. This tip shows ...

Discover More

Using Folder Templates

Windows is highly customizable. One way you can customize it is by changing what the File Explorer looks like. This can ...

Discover More

Determining How Much Space the Files in a Folder Require

Want to know how much space is required by all the files in a folder? There are a couple of very easy ways to get this ...

Discover More

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 8 + 1?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)

Newest Tips