Answered by:
How to get a list of all files and folders in a document library?

Question
Answers
-
Would you be comfortable with your uses running batch files then? If you were confident, you could write a short guide that shows them: -
- How to map a SharePoint library to a drive
- How to open command prompt and change directory to the mapped drive
- using the dir /s /b > print.txt
Viola.
Assuming that they don't struggle with copy and paste, that should get them started.
- Marked as answer by Carltonw1 Thursday, September 19, 2013 3:25 PM
All replies
-
You can get that information in various ways, the easiest way to do it is to export the library to excel using the button on the ribbon.
You might need to create a new view to get all the items, you can create one that shows all items even if they are in folders.
- Edited by Alex Brassington Wednesday, September 18, 2013 5:38 PM
-
Hi,
one way of achieving that is by using Powershell
You can use a script similar to this one to list all the files and folders recursively.
$SPweb = Get-SPWeb –identity “<yourweb url>” write-host $SPweb.title ":" $SPweb.URL -ForegroundColor DarkMagenta foreach($list in $SPweb.lists) # Iterate around all lists in a site { foreach($item in $list.items) { Write-Host $item.Title } GetFiles($list.RootFolder) } Function GetFiles($folder) { Write-Host "+"$folder.Name foreach($file in $folder.Files) { Write-Host "`t" $file.Name } # Use recursion to loop through all subfolders. foreach ($subFolder in $folder.SubFolders) { Write-Host "`t" -NoNewline GetFiles($Subfolder) } }
In the example above we are iterate through all the lists on the selected web. But you can adapt the code to receive a list name or URL to list only the document from that specific list.
Hope this help you.
Thanks.
Best regards,
Nuno Costa
- Proposed as answer by romeo doncaMVP Thursday, September 19, 2013 2:33 PM
- Unproposed as answer by Steven AndrewsEditor Thursday, September 19, 2013 3:40 PM
-
I'm able to change the view and show all of the documents, even those in folders, but I can't the folder name listed that it's under. How can I change the view so it shows the folder it's in as well?
I'd like to give the user the capability to do this without having to script it.
thanks.
-
Would you be comfortable with your uses running batch files then? If you were confident, you could write a short guide that shows them: -
- How to map a SharePoint library to a drive
- How to open command prompt and change directory to the mapped drive
- using the dir /s /b > print.txt
Viola.
Assuming that they don't struggle with copy and paste, that should get them started.
- Marked as answer by Carltonw1 Thursday, September 19, 2013 3:25 PM
-
Steven,
I didn't think about mapping the doc libraries as a drive. That works perfectly. thanks.
- Proposed as answer by Barberouss Wednesday, February 21, 2018 6:56 PM
- Unproposed as answer by Barberouss Wednesday, February 21, 2018 6:56 PM
-