3

I have Windows Server 2008 Enterprise. I need to copy files from network folder, I connected as a Z: drive. I need to schedule the copy. In scheduler I run it every 5 minutes.

robocopy.exe Z:\ C:\destination /E

I've tried to put it to .bat file, tried to write in scheduler, it doesn't help. I've set run with highest privilegies...

Task Scheduler successfully completed task "\RoboCopy" , instance "{dd2d2d1c-4ef1-4e30-b226-4a77aa52dab9}" , action "C:\Windows\SYSTEM32\cmd.exe" with return code 16.

1
  • Does scheduled task run as another account? If it does, the network folder is also mapped as Z drive? And that account has permission to access network folder?
    – Tanarri
    Aug 12, 2009 at 19:35

4 Answers 4

6

Is there some reason you are not providing a UNC to robocopy? I find that using a UNC is much more reliable then depending on a mapped drive in a scheduled task.

2

From technet -

Exit code16

Robocopy did not copy any files.  Check the command line parameters and verify that Robocopy has enough rights to write to the destination folder.

This sounds like it could be a permission issue. Scheduled tasks typically run as a separate user and your z: may not be accessible and mapped by the user used for the task.

I recommend running as a network user that has permission on the remote drive, and instead of using z:, use \\computer_name\share as this should get around the permission problem.

For a list of exit codes, look here - http://blogs.technet.com/deploymentguys/archive/2008/06/16/robocopy-exit-codes.aspx

1

Are both the source and the destination on the same network? I had this problem in the past where my mapped drive was at a remote location and I had to allow the SMB traffic in both directions and at both sites. Also be sure to look at your OS firewalls.

Another troubleshooting step you can take is add the /LOG:c:\path\to\logfile.txt flag so you can examine the output in the future.

0

This question comes up a lot, the first answer (Zoredache) is usually the fix for anyone necro diving for answer.

Replace robocopy A: B: /* with robocopy \\server1\share \\server2\\share /*

make the backslash a double.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .