4

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.

SenorWaffels
  • 93
  • 1
  • 1
  • 6
  • 1
    Does `dir G:` actually shows G drive content ? is G drive a local drive or a remote mapped shared directory ? – krisFR Apr 22 '15 at 11:27
  • I mapped our network drive to G: and i double checked it, it shows me content. – SenorWaffels Apr 22 '15 at 11:33
  • 2
    Try replacing `G:` with `\\server\path_to\directory` within your Robocopy command line – krisFR Apr 22 '15 at 11:34
  • Also tried that, thats the reason we mapped the drive because that method isnt working. – SenorWaffels Apr 22 '15 at 11:37
  • Could be permissions, can you try and run your CMD window as administrator. – Ankh2054 Apr 22 '15 at 11:45
  • UNC path \\server\path should also work, so could be permissions. Don't suppose you are running it as a scheduled task? – Ankh2054 Apr 22 '15 at 11:45
  • 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. – Reaces Apr 22 '15 at 11:46
  • what is /v/ the trailing slash shouldn't be there, but well, I don't suppose that's the problem? – Lenniey Apr 22 '15 at 11:46
  • The /v/ is just a typo, its not in the actual command, and we tried G:, no results. – SenorWaffels Apr 22 '15 at 12:05
  • It is runned as Administrator, also the permission are just fine. – SenorWaffels Apr 22 '15 at 11:56
  • As you are only guessing, leaving this just a comment is appropriate. – Sven Apr 22 '15 at 12:19
  • Have you tried it on both servers? The actual robocopy command I mean, "pushing" or "pulling" the files. – Lenniey Apr 22 '15 at 12:28
  • 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! – SenorWaffels Apr 22 '15 at 12:32
  • @Luukwa alright, let us know! – Lenniey Apr 22 '15 at 13:19
  • @Lenniey Well it didnt work out.. – SenorWaffels Apr 23 '15 at 07:55
  • @Luukwa Could you try running it as normal user, not as an admin? And / or not with an elevated command prompt? – Lenniey Apr 23 '15 at 08:05
  • @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 – Lenniey Apr 23 '15 at 08:11
  • 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 May 12 '15 at 06:20

2 Answers2

10

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.

iwaseatenbyagrue
  • 3,588
  • 12
  • 22
Avni
  • 116
  • 2
  • 4
  • 2
    Almost 2 years late, but thanks a bunch! This is still very useful! – SenorWaffels Mar 13 '17 at 08:57
  • 1
    Awesome, this worked for me perfectly, thanks so much! – Steve Bauman Jan 23 '19 at 21:00
  • 1
    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. – CreativiTimothy Jul 05 '20 at 02:04
1

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

Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47