Using Robocopy with File Sizes and Ages

by Barry Dysert
(last updated September 8, 2014)

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 and 8.

Author Bio

Barry Dysert

Barry has been a computer professional for over 30 years, working in different positions such as technical team leader, project manager, and software developer.  He is currently a senior software engineer with an emphasis on developing custom applications under Microsoft Windows. ...

MORE FROM BARRY

Displaying Hidden and System Files in a Folder

Files (and folders) can be marked hidden so that you don't see them in Windows Explorer. This tip tells you how to configure ...

Discover More

Understanding Windows Slide Show

If you have folders containing pictures, you may want to display them in a slide show. This tip explains how to do it.

Discover More

Moving the Pictures Library

The Pictures folder is one of several system libraries created in Windows by default. This library is specifically optimized ...

Discover More
More WindowsTips

Deleting Files or Folders

Part of managing the files and folders on a system is the need to occasionally delete them. Here's a quick discussion on a ...

Discover More

Repairing Your System Using a System Repair Disk

If your system gets into a state where it cannot be started normally, this tip presents you with options of how you can ...

Discover More

Displaying Details about an Audio File

Audio files have additional attributes that other files don't have. This tip describes how you can display these additional ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WindowsTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

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}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 8Mpixels. 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 eight more than 8?

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


Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in WindowsTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.