locked
How to export content of Library to text? RRS feed

  • Question

  • I would like to have a simple text listing of the files in a library, consisted of those from several folders. Normally you can do something like "dir c:\folder > content.txt" in a command prompt, but I don't know if the library is even accessible via command prompt. Does anyone know?

    Related to this, a quick tip for those annoyed by libraries only accepting indexed folders, you can include dummy folders in the library first, then replace them with symlinks of the same name pointing to the actual non-indexed folders. This way you can include even a networked folder from a XP machine.
    Monday, December 7, 2009 5:35 PM

Answers

  • Hi,

    As you already know that the Libraries in Win7 is a consolidated view of multiple folders, not a real folder. In some ways, a library is similar to a folder. For example, when you open a library, you'll see one or more files. However, unlike a folder, a library gathers files that are stored in several locations. This is a subtle, but important, difference. Libraries don't actually store your items. They monitor folders that contain your items, and let you access and arrange the items in different ways.

    The configuration for a library is stored in the Library-MS files in %appdata% \Microsoft\Windows\Libraries folder, and you can find all Libraries have a .library-ms extension. In order to get a better, you can open the configuration file (simply drag the file to an open Notepad or save it as .xml and use IE to open it), it’s xml style. If it worked as a shortcut, how can we use dir to list the folder instruct?

    E.g. attached the content of Music.library-ms file, you can see there are three locations/folders added to my Music Library:
    %USERPROFILE%\Music   {4BD8D571-6D19-48D3-BE97-422220080E43}
    %PUBLIC%\Music   {3214FAB5-9757-4298-BB61-92A9DEAA44FF}
    D:\gordon\Music
    ----------------

    <?xml version="1.0" encoding="UTF-8"?>
    <libraryDescription xmlns="http://schemas.microsoft.com/windows/2009/library">
      <name>@shell32.dll,-34584</name>
      <ownerSID>S-1-5-21-3017439185-3275328416-1127521385-12882</ownerSID>
      <version>9</version>
      <isLibraryPinned>true</isLibraryPinned>
      <iconReference>imageres.dll,-1004</iconReference>
      <templateInfo>
        <folderType>{94d6ddcc-4a68-4175-a374-bd584a510b78}</folderType>
      </templateInfo>
      <propertyStore>
        <property name="HasModifiedLocations" type="boolean"><![CDATA[true]]></property>
      </propertyStore>
      <searchConnectorDescriptionList>
        <searchConnectorDescription publisher="Microsoft" product="Windows">
          <description>@shell32.dll,-34586</description>
          <isDefaultSaveLocation>true</isDefaultSaveLocation>
          <simpleLocation>
            <url>knownfolder:{4BD8D571-6D19-48D3-BE97-422220080E43}</url>
            <serialized>/*Removed*/</serialized>
          </simpleLocation>
        </searchConnectorDescription>
        <searchConnectorDescription publisher="Microsoft" product="Windows">
          <description>@shell32.dll,-34588</description>
          <isDefaultSaveLocation>false</isDefaultSaveLocation>
          <isDefaultNonOwnerSaveLocation>true</isDefaultNonOwnerSaveLocation>
          <simpleLocation>
            <url>knownfolder:{3214FAB5-9757-4298-BB61-92A9DEAA44FF}</url>
            <serialized>/*Removed*/</serialized>
          </simpleLocation>
        </searchConnectorDescription>
        <searchConnectorDescription>
          <isSupported>true</isSupported>
          <simpleLocation>
            <url>D:\gordon\Music</url>
            <serialized>/*Removed*/</serialized>
          </simpleLocation>
        </searchConnectorDescription>
      </searchConnectorDescriptionList>
    </libraryDescription> 
    ----------------

    Meanwhile, both Windows Media Player and Windows Media Center make use of libraries to determine where media is located. Adding a folder to a library from Windows Explorer will also make that folder visible in Windows Media Player and Windows Media Center since they all share the same configuration. Remember, it’s only include media Libraries “Music”, “Pictures” and ”Videos”.

    PS: Your tip is very used in some Libraries related issues, thx for sharing

    • Marked as answer by Roland Fang Wednesday, December 9, 2009 6:43 PM
    Wednesday, December 9, 2009 5:25 AM

All replies

  • In my opinion, you can export the content of the Library of the Windows Media Player.


    John
    Tuesday, December 8, 2009 1:43 PM
  • In my opinion, you can export the content of the Library of the Windows Media Player.


    John

    Thanks for the input but I'm a little confused. Does WMP's library function even serve the same purpose, namely allow you to treat folders from all over, including network folders, as one single mega-folder? How would it deal with non-media files?
    Tuesday, December 8, 2009 3:49 PM
  • Hi,

    As you already know that the Libraries in Win7 is a consolidated view of multiple folders, not a real folder. In some ways, a library is similar to a folder. For example, when you open a library, you'll see one or more files. However, unlike a folder, a library gathers files that are stored in several locations. This is a subtle, but important, difference. Libraries don't actually store your items. They monitor folders that contain your items, and let you access and arrange the items in different ways.

    The configuration for a library is stored in the Library-MS files in %appdata% \Microsoft\Windows\Libraries folder, and you can find all Libraries have a .library-ms extension. In order to get a better, you can open the configuration file (simply drag the file to an open Notepad or save it as .xml and use IE to open it), it’s xml style. If it worked as a shortcut, how can we use dir to list the folder instruct?

    E.g. attached the content of Music.library-ms file, you can see there are three locations/folders added to my Music Library:
    %USERPROFILE%\Music   {4BD8D571-6D19-48D3-BE97-422220080E43}
    %PUBLIC%\Music   {3214FAB5-9757-4298-BB61-92A9DEAA44FF}
    D:\gordon\Music
    ----------------

    <?xml version="1.0" encoding="UTF-8"?>
    <libraryDescription xmlns="http://schemas.microsoft.com/windows/2009/library">
      <name>@shell32.dll,-34584</name>
      <ownerSID>S-1-5-21-3017439185-3275328416-1127521385-12882</ownerSID>
      <version>9</version>
      <isLibraryPinned>true</isLibraryPinned>
      <iconReference>imageres.dll,-1004</iconReference>
      <templateInfo>
        <folderType>{94d6ddcc-4a68-4175-a374-bd584a510b78}</folderType>
      </templateInfo>
      <propertyStore>
        <property name="HasModifiedLocations" type="boolean"><![CDATA[true]]></property>
      </propertyStore>
      <searchConnectorDescriptionList>
        <searchConnectorDescription publisher="Microsoft" product="Windows">
          <description>@shell32.dll,-34586</description>
          <isDefaultSaveLocation>true</isDefaultSaveLocation>
          <simpleLocation>
            <url>knownfolder:{4BD8D571-6D19-48D3-BE97-422220080E43}</url>
            <serialized>/*Removed*/</serialized>
          </simpleLocation>
        </searchConnectorDescription>
        <searchConnectorDescription publisher="Microsoft" product="Windows">
          <description>@shell32.dll,-34588</description>
          <isDefaultSaveLocation>false</isDefaultSaveLocation>
          <isDefaultNonOwnerSaveLocation>true</isDefaultNonOwnerSaveLocation>
          <simpleLocation>
            <url>knownfolder:{3214FAB5-9757-4298-BB61-92A9DEAA44FF}</url>
            <serialized>/*Removed*/</serialized>
          </simpleLocation>
        </searchConnectorDescription>
        <searchConnectorDescription>
          <isSupported>true</isSupported>
          <simpleLocation>
            <url>D:\gordon\Music</url>
            <serialized>/*Removed*/</serialized>
          </simpleLocation>
        </searchConnectorDescription>
      </searchConnectorDescriptionList>
    </libraryDescription> 
    ----------------

    Meanwhile, both Windows Media Player and Windows Media Center make use of libraries to determine where media is located. Adding a folder to a library from Windows Explorer will also make that folder visible in Windows Media Player and Windows Media Center since they all share the same configuration. Remember, it’s only include media Libraries “Music”, “Pictures” and ”Videos”.

    PS: Your tip is very used in some Libraries related issues, thx for sharing

    • Marked as answer by Roland Fang Wednesday, December 9, 2009 6:43 PM
    Wednesday, December 9, 2009 5:25 AM
  • Thanks for the info Gordon. I can try to extract the file names from the .XML file.
    Wednesday, December 9, 2009 6:44 PM
  • Wow, talk about the roundabout way to get there from here!

    Here's an way to get a listing of the paths for what you can see in a given view:

    1.  Select all the files and folders in a Libraries folder (this works with any Explorer view, actually).

    2.  Holding down the shift key, put the mouse over any of the selected items and Right-Click.

    3.  When the context menu comes up, Left-Click on "Copy As Path".

    4.  Paste what's in the clipboard into a text editor.

    Hope this helps!

    -Noel

    • Proposed as answer by Noel Carboni Wednesday, December 9, 2009 7:08 PM
    Wednesday, December 9, 2009 7:08 PM
  • Noel, thanks a lot for your sharing ^^

    It’s an easier method to get a copy of the folder location list

    I cannot find a way to copy the tree view list (including sub-folders and files in sub-folders)

    Thursday, December 10, 2009 1:30 AM