Robocopy cannot find specific directory

25,908

Solution 1

I had the same problem with a mapped drive. I found the answer on the technet forums.

This is caused by running with highest privileges(on the local system). Please run as the user not as administrator. Normally the administrator only has local access, no access to the server.

This problem is caused by running the command as administrator (on the old server). Running the command as a non-administrator user will resolve the problem.

Solution 2

changing the registry key for short files names as part of the cleanup suggested in the Best Practice Analyzer. The key it told me to modify was this one.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\NtfsDisable8dot3NameCreation

It was defaulted to 2 and I had changed it to 1 as per the BPA. I went back and changed it back to 2 and reran the robocopy script without errors.

Just wanted to let people know what worked for me:

reg add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v NtfsDisable8dot3NameCreation ^
 /t REG_DWORD /d 2 /f

My windows 10 1909 (18363.778) was defaulted 0. I just set 2 and now it works like a charm.

Thank you

Share:
25,908

Related videos on Youtube

SenorWaffels
Author by

SenorWaffels

Updated on September 18, 2022

Comments

  • SenorWaffels
    SenorWaffels 8 months

    I am migrating our file server from 2008 to 2012R2. Currently i am trying to copy all folders and files to our new server but the command isnt working correctly.

    Here is what i am using:

    robocopy G: D:\ /e /zb /COPY:DATSOU /r:3 /w:1 /v/ /eta /log+:C:\robocopy\copyreport.txt /tee /sec /tbd
    

    But for some reason its NOT working.. it cant find the specific path. I checked and double checked and im 100% sure the paths are working and are correct.. i had an error before with the log file but resolved that.

    Anyone knows whats wrong?

    Actual error: 2015/04/22 11:24:56 ERROR 3 (0X00000003) Accessing Source Directory G:\ The system cannot find the path specified.

    • krisFR
      krisFR about 8 years
      Does dir G: actually shows G drive content ? is G drive a local drive or a remote mapped shared directory ?
    • SenorWaffels
      SenorWaffels about 8 years
      I mapped our network drive to G: and i double checked it, it shows me content.
    • krisFR
      krisFR about 8 years
      Try replacing G: with \\server\path_to\directory within your Robocopy command line
    • SenorWaffels
      SenorWaffels about 8 years
      Also tried that, thats the reason we mapped the drive because that method isnt working.
    • Ankh2054
      Ankh2054 about 8 years
      Could be permissions, can you try and run your CMD window as administrator.
    • Ankh2054
      Ankh2054 about 8 years
      UNC path \\server\path should also work, so could be permissions. Don't suppose you are running it as a scheduled task?
    • Reaces
      Reaces about 8 years
      Have you tried with G:\ in stead of G: ? Even though your error message seems to indicate that you did, the robocopy command above does not.
    • Lenniey
      Lenniey about 8 years
      what is /v/ the trailing slash shouldn't be there, but well, I don't suppose that's the problem?
    • SenorWaffels
      SenorWaffels about 8 years
      It is runned as Administrator, also the permission are just fine.
    • FooBee
      FooBee about 8 years
      As you are only guessing, leaving this just a comment is appropriate.
    • Lenniey
      Lenniey about 8 years
      Have you tried it on both servers? The actual robocopy command I mean, "pushing" or "pulling" the files.
    • SenorWaffels
      SenorWaffels about 8 years
      Well i did try this before in a virtual machine, and it worked perfectly, the suggestion you gave we didnt try, doing that tommorow, thanks!
    • Lenniey
      Lenniey about 8 years
      @Luukwa alright, let us know!
    • SenorWaffels
      SenorWaffels about 8 years
      @Lenniey Well it didnt work out..
    • Lenniey
      Lenniey about 8 years
      @Luukwa Could you try running it as normal user, not as an admin? And / or not with an elevated command prompt?
    • Lenniey
      Lenniey about 8 years
      @Luukwa What I remembered now: I had a similar problem when running robocopy in a batch file. I had to map the network drives INSIDE the batch, because otherwise robocopy couldn't use them...don't know why, but maybe it's worth a try
    • SenorWaffels
      SenorWaffels about 8 years
      Sorry for the late respond, was on holiday. So it appears you cant use a shared directory like //server01. You have to use //server01/DIRECTORY for it to work, so i made 2 scripts that copy different directory's.
  • SenorWaffels
    SenorWaffels about 6 years
    Almost 2 years late, but thanks a bunch! This is still very useful!
  • Steve Bauman
    Steve Bauman over 4 years
    Awesome, this worked for me perfectly, thanks so much!
  • CreativiTimothy
    CreativiTimothy almost 3 years
    Would you mind showing how to run it as user and not administrator? I simply double click my batch file to run it, and I don't click "Run as administrator". My robocopy is very simple: robocopy "C:\Users\user\Documents" "F:\Backup Full" I get error 2 instead of error 3 compared to op though: "ERROR 2 (0x00000002) Accessing Destination Directory C:\Users\user\Documents\ The system cannot find the file specified." The script was working a few days ago, and I made no changes but suddenly it didn't work today.