Robocopy Access Denied RRS feed

  • Question

  • I'm trying to run this command: robocopy /mir /sec "\\pr-share\G$\GDrive" \\pr-na-3210-a\Company_Share" and essentially get random "access is denied waiting 30 seconds, ERROR 5 (0x00000005)". I want to mirror the source and destination so that I can properly cut this over. What command can I run that will secure permissions as well as not give me this error?
    Tuesday, September 18, 2012 7:25 PM


  • Just run the same robocopy command a second time to effectively do an incremental, it will scan through and only copy files that have been updated or are new.
    • Marked as answer by Chicojrman1 Tuesday, October 16, 2012 1:03 PM
    Monday, October 15, 2012 10:47 AM

All replies

  • Have you tried RunAs Administrator? (elevated rights)



    Tuesday, September 18, 2012 8:55 PM
  • Yes, and still same issue. Also changed ownership of file and it still doesn't work.
    Tuesday, September 18, 2012 8:57 PM
  • Try running the robocopy command without the /sec switch. If this fails then I would assume that you don't have sufficient access to destination share (I'll assume that the source access is verified at this point). If it works without the security switch, then it probably means that you need to take ownership of the destination folder before trying to set security permissions on it with robocopy. Of course, I think if you were to create a subfolder under \\pr-na-3210-a\Company_Share, that might also solve the problem.

    Tuesday, September 18, 2012 10:13 PM
  • I'll try the creating the subfolder but here is the exact error.

    Tuesday, September 18, 2012 10:56 PM
  • Okay, I run this initial command: robocopy /mir /sec "\\pr-share\G$\GDrive" \\pr-na-3210-a\Company_Share"

    successfully and now would like to know the command to run to update files after. Like a Incremental so that I'm not backing up all over again?


    Friday, October 12, 2012 2:06 PM
  • Just run the same robocopy command a second time to effectively do an incremental, it will scan through and only copy files that have been updated or are new.
    • Marked as answer by Chicojrman1 Tuesday, October 16, 2012 1:03 PM
    Monday, October 15, 2012 10:47 AM
  • Thought I'd add a solution that I found elsewhere on TechNet to this thread because it's currently the first hit on Google for "robocopy access is denied".

    The "Access is denied" message can be issued by robocopy (and other command line tools) when a file has an NTFS stream that tags the file as having been downloaded from the Internet or copied from a share.

    The stream is called Zone.Identifier. For example:

    > more < myfile.txt:Zone.Identifier:$DATA

    To delete the stream (and any other streams) from files to backup, use the Streams utility by Mark Russinovich (SysInternals). For example:

    > streams -s -d c:\myfiles

    • Proposed as answer by Gerrit Zwart Wednesday, July 2, 2014 11:25 AM
    Sunday, December 1, 2013 11:20 PM
  • hi

    how to use the stream?

    with robocopy command?


    Wednesday, June 11, 2014 12:50 PM
  • Yes, I also face the similar problem when copying my File Server to CIFS share as follows:

    2014/07/04 08:58:44 ERROR 5 (0x00000005) Creating Destination Directory \\EMC-DataDomain\CIFS_SHARE\Vault1_Pt14\found.000\dir0000.chk\ Access is denied.

    So how to mitigate that ?

    /* Server Support Specialist */

    Friday, July 4, 2014 3:32 PM
  • This did not work for me I uses command:

    robocopy "C:\Program Files\WindowsApps" "F:\Windows 8\WindowsApps" /E /COPYALL /DCOPY:DAT

    and yes im running cmd on admin

    i also changed the ownership with takeown

    • Edited by PhuongHo94 Friday, October 24, 2014 7:47 AM
    Friday, October 24, 2014 7:46 AM
  • Also add another one to the possible root causes as this is the first result

    File Server Resource Manager -> File Screens

    Filescreens was giving me an access denied while trying to copy data as well

    • Proposed as answer by mxchaos Wednesday, February 8, 2017 10:48 AM
    Wednesday, February 8, 2017 10:47 AM
  • On source computer e.g. desktop, open command prompt as "Run as different user" (shift+right click on Command Prompt). Login as same user you would log on to target Windows server

    On target server create folder where you would want to copy source files/folder

    Use following command to copy all content of \temp onto target server folder \temp

    robocopy C:\Users\user_1\Documents\temp "\\<TargetServerIP>\D$\temp" /E

    where, D$ is D:

    Wednesday, April 5, 2017 7:14 PM
  • before robocopy map the network drive/folder with your drive.

    net use \\usrsvr002\smithmark Ue345Ii /user:pdc01\msmith2 /savecred /p:yes


    net use \\IPAdress\D$\folderpath Ue345Ii /user:pdc01\msmith2 /savecred /p:yes

    here Ue345Ii is the password ,

    pdc01 is domain,

    msmith2 is the user name of the network system.

    It may help , for me it works.

    Thank you.

    Thelukutla Lokesh

    Thursday, November 16, 2017 2:07 PM
  • I have the same issue.  Source drive is a removable drive and the target is a Netgear NAS drive.

    this is my command line

    RoboCopy "N:\MCD-BackUp\clientdocs" "\\nas-doc-server\clientdocs"  *.* /TEE /E /B /FFT /copy:DATSOU /R:1 /W:10 /log:%Logname%

    I can copy these files without issue using windows 7 file manger/explorer so why is robocopy spitting the dummy.....

    Tuesday, March 13, 2018 7:11 AM
  • I've seen before where robocopy says access denied, you double-click to open the "denied" folder, Windows grants you the permissions change, then you have to close CMD window and try again.
    Thursday, March 29, 2018 7:13 PM
  • This fixed my problem, stupid AFP alternate data streams suddenly appears all over the place. who know why.
    Thursday, November 29, 2018 10:37 PM
  • xcopy /C/H/R/S/Y c:\ d:\
    /C = Continues copying even if errors occur
    /H = Copies hidden and system files also
    /R = Overwrites read-only files
    /S = Copies directories and subdirectories
    /Y = Overwrites existing files without asking
    • Proposed as answer by Craig A. Stone Wednesday, March 13, 2019 2:26 AM
    Wednesday, March 13, 2019 2:25 AM

    Wednesday, March 13, 2019 2:27 AM
  • Thank you so much! I forgot to do this. 
    Wednesday, August 21, 2019 7:30 PM