We help IT Professionals succeed at work.

Robocopy problem with Maximum setlocal recursion.

When running Robocopy to copy files from one share to another I receive the following output.  

"Maximum setlocal recursion level reached".

This output runs continuously until I manually kill the job.

I have tried the following robocopy script straight from DOS and also thru a bat file.

robocopy \\server\mysqlbackups f:\MYSQL *.* /MOV

What would cause this?



Comment
Watch Question

Top Expert 2007

Commented:
what if you try it without the *.* (it's assumed anyway)

Author

Commented:
Same error after removing *.*
Most Valuable Expert 2015

Commented:
what happens if you stop sql services before doing the copy?

Author

Commented:
After stopping SQL services the same problem exists.
Top Expert 2007

Commented:
What if you limit the file specs to a certain you type?
Instead of *.* use *.txt (or some other spec)
Most Valuable Expert 2015

Commented:
Try:

robocopy "\\server\mysqlbackups" "f:\MYSQL" *.* /MOV

Also replace \\server with \\IPAddress if you haven't already tried that.
Most Valuable Expert 2019
Most Valuable Expert 2018
Commented:
You've probably named the script itself "robocopy.bat" or "robocopy.cmd" (or have a script with that name around somewhere), so the script calls itself instead of robocopy.exe. Either specify the full path and name to robocopy.exe in the script, or rename the script.
Top Expert 2007

Commented:
Yep - I figured that was it when I saw your post oBdA...good call! :^)