Robocopy Stopped Working "Access Denied"
Posted on 2013-11-05
Something change this last week that is preventing my Robocopy to work now. It has been doing fine for the last year.
I have a script that:
1. Maps two network drive locations using a service account
2. Excecutes the Robocopy command to put a copy of xml files I have in a folder on my 2008 file share server into one mapped network drive
3. Execute the Robocopy command to next moved those xml files to the 2nd mapped network drive
4. Disconnect the mapped network drives.
Since last week, step number 2 fails with an access denied error (ERROR 5 (0x00000005)).
The rest of the script works fine. Both network drives map, the file moves to the 2nd mapped drive with no problems.
What is strange is the permissions had not to my knowlege changed on the mapped drive that failed. And, since it's mapped I can manually copy the files there with no problems with that same service account.
It appears to just be the RoboCopy command that stopped working.
I've read through lots of "Access Denied" solutions to include the "/Copy:DT" and that does not solve my issue.
Does anybody with experience on RoboCopy have some thoughts on how to fix this? I'd hate to give up robocopy and use xcopy as a solution.
Here is a edited version of my script:
NET USE P: \\1stServer\ABCFolder "FakePassword" /user:MyDomain\svcMyServiceAccount /persistent:no
NET USE Q: \\2ndServer\2ndABCFolder "FakePassword" /user:MyDomain\svcMyServiceAccount /persistent:no
robocopy.exe \\MyLocalServer\MyFolder P:
robocopy.exe \\MyLocalServer\MyFolder Q: /MOV
NET USE P: /delete
NET USE Q: /delete