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.

link|improve this question

70% accept rate
feedback

4 Answers

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

link|improve this answer
Good thought, but I already tried it with the same result. – DCookie Jan 4 '10 at 5:59
feedback

Just a tip for anyone struggling with Windows 7 vs. Samba setups:

http://makingwindowseasy.com/2009/12/23/fixing-windows-7-samba-issues/

Although this doesn't seem to be exactly the same problem.

link|improve this answer
feedback

Make sure that the account you connect with has permission on the server side to create directories Z:\Dest_dir\

mkdir z:\Dest_dir\test creates the same result?

As said above, i'd check the permissions on the server side.

link|improve this answer
Mkdir yields "directory already exists". I know I have permissions to create directories, because the commands succeed if the directory is not there. – DCookie Jan 4 '10 at 14:50
feedback

Sorry to resurrect a question from the dead, but I would guess that you need to take a look at your create mask in your samba settings. The default is 755, so if your user account is not the owner of the directory then any new directories or files you create will not be writable by that account. The root directory probably has more permissive unix file permissions, perhaps 775, which is why you're able to create new files and directories in the first place.

link|improve this answer
Why apologize? I still haven't figured it out, so I'll double check the settings. However, why does this only occur on Win7 systems? XP works fine, remember... – DCookie Aug 6 '10 at 18:46
Appreciate the input. – DCookie Aug 6 '10 at 18:46
Are you using the same user account on all machines? – Matt Aug 9 '10 at 19:48
Yes, the same account. – DCookie Aug 12 '10 at 14:49
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.