Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to synchronize two folders. I am trying to synch a WebDAV mapped drive folder (Z:\Images) with a folder on a hard drive on my local computer (E:).

Here is the command I am running:

xcopy E:\Images Z:\Images /D /E

Here is the error message I get:

File creation error - The directory is not empty.

Unable to create directory - Z:\images
0 File(s) copied

I can use xcopy to copy from a local folder to an empty directory on the WebDAV drive.

The WebDAV drive works perfectly find when trying to access or modify via Windows Explorer. Also, the xcopy command works fine when using two local folders or when the remote directory is actually empty.

Source machine is a Windows 7 machine and destination machine is a Windows Server 2008 machine.

share|improve this question
Have you added a /Y to allow overwriting the destination directory? Otherwise, I've had better luck with xcopy E:\Images*.* Z:\Images*.* /D /E /Y – Paul Ackerman Jan 17 '12 at 20:43
Have you tried robocopy instead of xcopy? – jftuga Jan 17 '12 at 20:43
up vote 1 down vote accepted

Are you trying to "mirror" the E: drive, meaning if you add/delete a file in E: you want it added/deleted in Z:? If so, robocopy would be your best bet.

The command would basically look like this: robocopy E:\Images Z:\Images /mir

If you need to mirror the ACLs, you could add /copyall as well.

share|improve this answer
This is exactly what I wanted. I also added the /XD option to exclude Subversion files. /XD _svn /XD .svn – jmacinnes Jan 23 '12 at 23:31
  1. Have you added a /Y to allow overwriting the destination directory? I've had better luck with: xcopy E:\Images*.* Z:\Images*.* /D /E /Y

  2. The account under which you are running xcopy may not have permission to delete the folder/files on the remote server. Check permissions on the server.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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