Linux – Windows 7 / Samba “access denied” message from xcopy

linuxsambawindows 7

I've got a Windows 7 Ultimate system which maps a Samba 3.0.33 share. I have no problems reading, writing, or replacing any files or directories from windows file explorer. I have attempted to set up a push/pull sync script on the windows client using xcopy. I am trying to replace any files newer than the corresponding file/directory in either direction. The copy from the server to the client works great. The copy from the client to the server fails with "access denied" (when the directory already exists – new directories can be created without issue).

This is my windows script:

xcopy c:\source_dir z:\dest_dir /D /E /I /F /R /Y
xcopy z:\dest_dir c:\source_dir /D /E /I /F /R /Y

Here's what I see for the first command:

C:\Source_dir>xcopy c:\Source_dir\test z:\Dest_dir\test /E /I /F /R /Y
Access denied
Unable to create directory - Z:\Dest_dir\test
0 File(s) copied

The same command works fine on an XP system connected to the same server. There must be something I'm missing – any ideas what it might be?

Thanks!

PS: I forgot to mention that if the directory does not exist already on the server, the xcopy command to the server succeeds.

PPS: Robocopy yields identical results.

Best Answer

I would suggest switching to robocopy since xcopy /? says "NOTE: Xcopy is now deprecated, please use Robocopy."