I saw a posting on
requesting this, so I thought I would share here as well in case anyone needed this functionality.
The code contained in this file: SPPurgeList.txt , contains sample code to purge a list of all it’s contents and folders (Define WSSV3 for that).
If you need to retain the list itself (Maintaining it’s original GUID) without killing the entire list and re-creating, you can use this code to purge the list contents.
It should work on any list or document library. When I get a chance to really run it through the ringer, I may post it on my CodePlex site.
– Keith Richie