I need to copy a file from local server to SP library. That being said I've the below batch code which works well with my local folders, but when the link is replaced with sharepoint it doesn't copy.

pushd D:\test1
>nul Robocopy  /Maxage:1 D:\test2

I appreciate if I could get a solution similar to the above script, as I need to copy a file that is created today.

2 Answers 2


You will not be able to copy a file directly from disk into SP2007. Starting from SP2010 and up there are WebDav extensions that allow you to open a document library as a file folder but IIRC they do not exist in MOSS.

To copy a file, you will need to use web services (copy.asmx). See for example: http://oricode.wordpress.com/2008/07/03/upload-a-file-to-sharepoint-2007-using-webservices-with-a-specific-content-type/ or http://geek.hubkey.com/2007/10/upload-file-to-sharepoint-document.html

Or, you can use one of the many 3rd-party tools that will give you a nice GUI to upload files from a disk folder. For example, Sharegate (Disclaimer: I work for Sharegate's parent company)


would stsadm -import work for you?

stsadm -o import







[-updateversions] <1-3>




  • This is to import content migration packages, not single files
    – Louis
    Commented Mar 11, 2014 at 2:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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