RoboCopy (Robust File Copy) is a command-line file copying tool in Windows. It is designed for reliable copying or mirroring of directories anywhere the computer has access, including local drives, removable drives, Local Area Network, remote servers, and in the process ensures that all file properties and permissions stays intact. Aug 21, 2013 Hello, Am trying to execute a batch / cmd file with dynamic parameter to the batch file using t-sql / xpcmdshell. Basically am trying to execute a robocopy command from t-sql - read somewhere that this is not possible & i hav to wrap my command in batch file. Nov 08, 2019 When this occurs, Robocopy will retry the copy to see if the lock is no longer on the file. By default (if you don’t specify this parameter), Robocopy will retry the copy 1 million times. Knowing that we are going to try to copy this file again during the next scheduled run one day away, I am more than content with trying five retries, and if. I've searched online for a solution but all the problems seem to be the other way round where Robocopy is not copying locked files. Some more details regarding what I'm doing: My code calls Robocopy every 30 seconds with above flags (I know robocopy can loop by itself but It wasn't doing quite what I wanted).
Robocopy (aka “Robust File Copy”) is a very useful command-line directory and file replication tool that replaces and enhances the functionality of Xcopy, adding a slew of valuable options, especially when it comes to file synchronizations, mirroring and file backups in general.
One feature that Robocopy command line tool is missing is related to ignoring errors.
The only way I found around it, is to add 0 seconds and 0 retries option when copying or mirroring folders.
The following example illustrates drive mirroring (C: to X: drive), with error ignoring by leveraging the R and W switch: