-1

I am executing a robocopy command with my source on a and my destination is a local folder. However when robocopy runs and the server is down, it keeps repeating and retrying to find the folder every 30 seconds. I would like the robocopy to only run once, and return TRUE if succeeded and FALSE if it failed.

Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328
tlotr856
  • 3
  • 1

1 Answers1

3

When in doubt, read the documentation:

/r:<N> Specifies the number of retries on failed copies. The default value of N is 1,000,000 (one million retries).

Run robocopy source destination /r:0 to disable retries. Check the exit code for the command status.

Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328