Is there a way to programmatically move an existing list item (SPListItem) to a folder or do I need to make a new item that is a duplicate of the list item in the folder in question and then delete the old one?

2 Answers 2


It is not explicitly a file but you can still use it as one. Here's an example I've used before:

SPListItem item;
SPList list;
SPWeb web;
string DestinationFolderPath;
SPFile file = web.GetFile(item.Url);
string destinationUrl = list.RootFolder.ServerRelativeUrl.TrimEnd(new Char[] { '/' }) + "/" + DestinationFolderPath + "/" + item.ID.ToString() + "_.000";

You could make a new item that is a duplicate but you'll run into issues if you have lookups to that item. Since the new item will have a new ID, the lookup will be broken.


If its a file you can use the SPFile.MoveTo command.

  • SPListItem Not a file. Commented Sep 14, 2012 at 23:11

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.