Specifying a Copy Schedule in Robocopy

by Barry Dysert
(last updated August 25, 2014)


You can use the built-in scheduling capability of Robocopy to specify a copy schedule instead of resorting to the Windows Task Scheduler to perform copies. There are actually a few different ways to use a copy schedule. When you specify the /MON:n switch Robocopy stays running and continually monitors the source directory for changes. When it detects that "n" or more changes have occurred to the source directory it implements these changes in the destination. (That is, when files get created in the source, the files are automatically copied to the destination.)

C:\> ROBOCOPY C:\Temp1 C:\Temp3 /MON:1

You exit the running of Robocopy by pressing the CTRL+C combination.

Similar behavior exists by specifying the /MOT:m switch. In this case, Robocopy stays running and performs another copy (if necessary) in "m" minutes' time if things have changed.

C:\> ROBOCOPY C:\Temp1 C:\Temp3 /MOT:1

So, with this command line, Robocopy looks for changes once every minute, and if there are any they are implemented. As before, press CTRL+C to stop Robocopy from running.

A third way of scheduling a copy is to use the /RH:hhmm-hhmm switch. This tells Robocopy that it can only copy files between the hours/minutes of the first "hhmm" and the second "hhmm". There are, of course, three scenarios here. If the timeframe specified with /RH has already passed, Robocopy will remain paused until the time occurs the next day. If the current system time is within the boundaries established with /RH then the copy occurs immediately. Finally, if the timeframe specified with /RH is in the future, Robocopy remains paused until the time occurs, and then the copy is performed. As an example:

C:\> ROBOCOPY C:\Temp1 C:\Temp3 /RH:1300-1400

This tells Robocopy to do its copying between the hours of 1300 and 1400 (1:00 pm and 2:00 pm).

 This tip (13219) 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. ...


Pinning a Shortcut to the Taskbar

It's usually easy to pin items to the Taskbar. But if what you want to pin is not a shortcut to an application? This tip ...

Discover More

Using the Character Map

There may be times when you need to insert special characters that aren't found on your keyboard. Windows provides a utility, ...

Discover More

Customizing the SendTo Menu

The SendTo menu can be used to perform some handy tasks with files. By following the steps in this tip you'll be able to ...

Discover More
More WindowsTips

Understanding ZIP Folders

Need to move a lot of information to someone else? The answer may be to store that information in a ZIP folder. Here's the ...

Discover More

Understanding File Types and Extensions

File types (or extensions) are key to using Windows effectively. When you double-click a file in Windows Explorer, the file ...

Discover More

Configuring Windows to Do Backups on a Schedule

Performing regular backups of your system offers you peace of mind because you don't have to worry about data loss in the ...

Discover More

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

View most recent newsletter.


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. 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 three minus 2?

2017-01-12 07:44:05


I'm not able to get /PF switch working? Anybody got any idea why?

Using these switches:

/NC /NDL /E /COPYALL /DCOPY:T /ZB /RH:1730-0700 /PF /ETA /MT:4 /R:1 /TEE /log+logfile.log

2016-12-04 16:34:36


I don't believe Robocopy can do what you need. The requirement of copying only 5000 files at a time is the sticking point.

2016-12-04 11:02:10


The requirement I have is to move files from a directory of 300,000 files(static) but only 5000 at a time to the destination directory. The process needs to be repeated every 2 hrs.

Does Robocopy have that option as I didn't see one. Are there any combinations which could help me acheive that.

2016-11-24 03:01:28

Eric Price

I use the /RH:1930-0730 switch for transferring backups to a data center overnight and it works just fine, but you might also want to include the /PF (per file) switch.

With the /PF switch it checks the run hours for each file rather than the whole batch, once it tries to copy a file outside of the run hours it will then pause until the start time is reached again.

My next 'to do' is to figure out how to tell if it's the weekend and keep going..

2016-02-10 11:34:30


David, I don't know if that's the case. Please do test and report back here for everyone's sake. Thanks!

2016-02-10 11:24:29

David I. McIntosh

Documentation on the /RH option is incomplete. In particular, what if the interval over which you want to copy spans midnight? For example, if I want to copy from 11pm to 1am, i.e. 23:00:00 to 01:00:00, how can I specify this? I would hope that I can specify '/RH:2300-0100', and that robocopy is smart enough to figure out that if the starting time is greater than the stopping time, (e.g. in this case 2300 > 0100), that the implication is that the interval spans midnight. In other words, the test for "copyingActive" should be:
if( startTime <= stopTime )
copyActive = (startTime<=currentTime) && (currentTime<stopTime);
copyActive = (startTime<=currentTime) || (currentTime<stopTime);

Do you know if this is the case? I am about to test, and will post back here, but this should be added to your documentation.

2015-05-04 18:13:25


Mark, although I haven't tried it, I suspect you'd get a file locked error, and depending on what options you gave Robocopy either the file would be skipped or your job would die.

2015-05-04 17:43:36


From what I can tell, I can use MS scheduler to run a robocopy command every 2 min. What happens when the first command has not finished copying files before the second instance launches? I am worried about action against a file that is still in the directory but has a status of open.

2015-01-29 10:03:24


1st and 3rd scenarios you gave for /RH flag are same. Another scenarios is when copy operation overshoots the time limit.

Newest Tips

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.