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

If Robocopy fails to copy a file (for any reason) it will retry up to 1 million times, waiting 30 seconds between each attempt.

Eventually, after 30 million seconds or about 1 year, robocopy will timeout and move on to the next file.

You can reduce the retry count with /r and shorten the wait time with /w.

E.g. robocopy c:\ d:\ /e /r:0 /w:0 

This says: If you encounter an error, don't retry.

Robocopy Retry & Wait parameters:

/R:n
Number of Retries on failed copies: default 1 million.
/W:n
Wait time between retries: default is 30 seconds.
/E
Copy subdirectories, including Empty ones.

The never ending error message you will see if a file can't be copied:

2018/02/06 09:19:13 ERROR 32 (0x00000020) Copying File .\sqlite3\db.lock
The process cannot access the file because it is being used by another process.
Waiting 30 seconds... Retrying...
 
2018/02/06 09:19:13 ERROR 32 (0x00000020) Copying File .\sqlite3\db.lock
The process cannot access the file because it is being used by another process.
Waiting 30 seconds... Retrying...
 
2018/02/06 09:19:43 ERROR 32 (0x00000020) Copying File .\sqlite3\db.lock
The process cannot access the file because it is being used by another process.
Waiting 30 seconds... Retrying...

Ads by Google


Ask a question, send a comment, or report a problem - click here to contact me.

© Richard McGrath