1

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

1 Answer 1

1

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.

1
  • 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, 2010 at 20:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .