SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

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 have a need to copy files placed in a network location into a SharePoint document library each morning.

I've tried to do this with a batch file that uses xcopy to copy from the shared drive, to SharePoint, like so;

xcopy "\\networkdrive\Files and Folders" "\\sharepoint\re\KC\System Report\" /Y

Unfortunately this throws the error:

File creation error - The directory is not empty.

Unable to create directory - \sharepoint\re\KC\System Report\ 0 File(s) copied

Is there a reason for this I can correct and if not what would be the best way to automate this process?

share|improve this question
If you run a script directly on the \\sharepoint server shuld you not be able to read files from \\networkdrive and upload them to a document library using either a PS script (not sure how in 2007) or a simple C# program and have this run in scheduled task? – eirikb Oct 5 '12 at 5:08
up vote 2 down vote accepted

Add *.* to the source like this:

xcopy "\\networkdrive\Files and Folders\*.*" "\\sharepoint\re\KC\System Report\" /Y 

This will copy the files in the directory instead of the directory

share|improve this answer

You can do it via xcopy, we've done it in the past. The sharepoint location should be mapped with the webdav address and be executed with a user account that has contribute permissions to the library.

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.