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

We have a sharepoint server that we are looking to script an extraction on a partial site.

The request is that they have a site that that can have multiple sub-folders. The file will then be extracted to a single folder.

I have done some digging and have found the following example that would extract files to a single folder:

XCOPY "\sharepointsvr\Dept\Library\".DOC C:\TMP /S /Y XCOPY "\sharepointsvr\Dept\Library\".DOCX C:\TMP /S /Y or

for /R "\sharepointsvr\Dept\Library\" %i IN (*.DOC) DO xcopy %i C:\TMP /M

I am looking at running this as a scheduled tasks form the server using a command script. The above script would dump the files and subfolders into a single (and that is what they would prefer)

My questions are the following.

Is there a way to tell if a files is checked out from a command prompt?
If so that it could be skipped?

If not is there a better way to achieve this data extraction for 'checked in files'?

thanks for any thoughts..

share|improve this question

Doing it from the command line probably won't be an option if you want to account for checked out files.

This means you will have to resort to using the SharePoint API to dump the files out. There is a codeplex project called SPIEFolder that will get you close. It is missing 2 features that you need, but if you have any .Net coding experience (or know somebody with such) it should be a pretty simple change. The 2 limitations in your situation are:

  • it dumps the files using the same folder structure as the original library
  • it dumps everything (including checked out items) so you have to add a check for that

Another plus is that if you're list/items are big, it should be much faster to do it using the API.

share|improve this answer
It is the part of only wanting to copy the 'checked in' files that is where I am having the trouble. Even if it was a two step process where I could get a listing for the files that are currently 'checked in' and then using that output to feed the file download would be great. Thanks Sorry no good at the scripting/.NET stuff as you might guess form the initial script. – Adam M. Mar 9 '10 at 20:10

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.