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?

  • 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 *.* 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

| 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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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