Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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
add comment

2 Answers 2

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
add comment

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
add comment

Your Answer

 
discard

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.