Skip Open Files Used by Another Process to Continue RoboCopy Copy or Move

»»»Skip Open Files Used by Another Process to Continue RoboCopy Copy or Move
When copying, moving, mirroring or replicating files and folders from source to destination location by using RoboCopy, the process may get stuck in repetitive infinite retry loop when RoboCopy is encountering open files that are being used by any processes.

In these cases, RoboCopy continues to attempt to retry the copying or moving the open files by pausing, and then retrying again repetitively with the following error message:

The process cannot access the file because it is being used by another process.

Waiting 30 seconds… Retrying…

RoboCopy Retry Infinitely

RoboCopy will retry until the file is closed, i.e. the file no longer being used by any processes.

However, sometimes the open file may not be released by the process that use it for hours, days, weeks or even infinitely, such as database files. As such, it’s important to skip the open files encountered by RoboCopy to ensure that most files are copied or moved to destination.

To skip open files while replicating, use the /w:1 /r:1 switches (of course you can change the number to any integer you like). For example,

 robocopy C:\ D:\ /w:1 /r:1

/R:n indicates number of retries on failed copies, such as those encountering on open files. By default RoboCopy retries for 1 million times.

/W:n indicates the wait time between retries. By default it is 30 seconds. If you want RoboCopy to skip any failed copy quickly, reduce it to lesser amount.

By | 2016-12-09T08:38:27+00:00 December 9th, 2016|Categories: Utilities|Tags: |3 Comments

About the Author:

LK is a technology writer for Tech Journey with background of system and network administrator. He has be documenting his experiences in digital and technology world for over 15 years.Connect with LK through Tech Journey on Facebook, Twitter or Google+.
  • Emily Rose

    I also encountered this error saying the files cannot be copied because its used by another process. I was also using robocopy but it failed to provide solution to the error. So I shifted to a better recommended software from my friend, GS Richcopy 360. This software solved all the errors related to file copying. It also provided me simple GUI which robocopy failed to do! Try it, its amazing!

  • Sophia Joseph

    I have used Robocopy to transfer files, but the GUI is still missing from it! Its not good for a newbie. At times it lags too when copying huge files. To solve this problem I have been using GS RIchcopy 360. Its a powerful tool which solved most of my problems related to file copying. It also solved open files problem. Its a suggestion from my side to use GS Richcopy 360 instead.

  • mmizutani

    This tip saved my life. Thank you very much!