I need to create a hierarchical directory of folders, subfolders, and their filename contents for a SharePoint document St Pauls Team Site. I have been granted full privileges. To do this, I followed the general procedure below and bracketed by ===============.
Basically, the suggested procedure is to run at the Command Prompt the instruction:
DIR /d /s [UNC] [pipe to file]
I could not generate [UNC] using the procedure suggested below but I did find a similar string in SharePoint for the document under the tab: St Pauls Team Site. an UNC that looked similar to what was shown:
stpauls220.sharepoint.com/Shared%20Documents/Forms/Allitems.aspx?
I Piped it to: c: stpaulSPfiles.txt
Under Command Prompt with Administrator privilege I entered the full command
C:\Windows\System32>DIR /d /s \ stpauls220.sharepoint.com/Shared%20Documents/Forms/Allitems.aspx? > c: stpaulSPfiles.txt
The following message was returned:
+++++++++++++++++++++
C:\Windows\System32>DIR /d /s \ stpauls220.sharepoint.com/Shared%20Documents/Forms/Allitems.aspx? > c: stpaulSPfiles.txt
Access is denied.
C:\Windows\System32>
+++++++++++++++++++
I would appreciate your guidance on the proper procedure to create a hierarchical directory of folders, subfolders, and their filename contents.
Regards,
Ernest Lippert
========================================================================
· https://www.sharepointgeoff.com/how-to-quickly-list-documents-and-sub-folders-from-a-document-library-in-sharepoint-to-a-file/
Assurance | Random Muslings
March 5, 2012
I have been asked by quite a few people on listing documents from document libraries that include sub-folders; so I’d like to share with you a poor-man method of listing all files and folders in a document library in SharePoint with hundreds of files and folders, and displaying the contents of this in NotePad.
Now, I know there are probably lots of nice little apps out there, and I must admit writing one myself called GEGETDOCCONFIG (which does a whole lot more). There’s also information on how to use Powershell to enumerate document libraries here – but you can very quickly list all files and folders from a DIRectory assuming you can get its UNC (Universal Naming Convention) path and you can access the entire document library. All you will need to do is to use the famous DIR command from the command prompt, and you can do this without having to log onto any of the servers in your SharePoint farm.
If you’ve spent much time working in a DOS-based environment, chances are that you’re very familiar with the DIR command. When used in its most basic form, the DIR command simply displays a list of all the files and subdirectories contained within a particular directory. However, the DIR command has access to a fleet of special command line parameters that allow it to perform a host of very specific file listing and sorting operations. While you can perform many of these operations in Windows Explorer, the speed and accuracy with which you can perform them with the DIR command is astounding. Furthermore, you can easily combine these command line parameters to create unique directory listings on the fly.
You will need access to the COMMAND PROMPT, so you can use it against the UNC. A UNC is a naming convention used primarily to specify and map network drives in Microsoft Windows. Support for UNC also appears in other operating systems via technologies. UNC names are most commonly used to reach file servers or printers on a LAN. UNC names identify network resources using a specific notation. UNC names consist of three parts – a server name, a share name, and an optional file path. We will need the UNC of the relevant SharePoint location and then use DIR against it.
Follow these steps:
Step 1: Get the UNC
Take for example, a document library whose contents you would like to list:
http://documents/Products/Forms/AllItems.aspx
Its UNC from Windows Explorer would be:
\documents\products
Make a note of the UNC path you will need it in the next step.
Step 2: Generate the List
So, to list all the files and the folders, off to DOS we go:
Click Start -> Accessories -> Command Prompt
Then, enter this command:
DIR /d /s (name of the above UNC path) > (name of the file you want to pipe the list to)
For example:
DIR /d /s \documents\products > c:\productfilelist.txt
This will list all the files and folders from the UNC path into productfilelist.txt. Then, all you need to do is open this in notepad or clean it up in Excel.
==========================================================================