Windows 7 Feature Focus: Libraries

Marcus_Soperus

Previous versions of Windows have included separate folders for documents, music, videos, and photos (such as Windows XP's My Documents, My Pictures, My Videos, and My Music folders). These folders made it convenient to organize and open different types of files - as long as they were stored in the appropriate folder . However, with the increasing popularity of using network shares and external hard disks for media storage, Windows users have faced challenges in file management.

Although shortcuts to additional media locations, symbolic links to other locations ( introduced in Windows Vista), and changing the default location used by a user's media files have all been used to cope with the problem, the results for Windows users have been:

  • A lot of clicking to find media files
  • No easy way to see all of the media files of a particular type in different locations at the same time

Enter the "new" Windows 7 libraries feature. Although earlier versions of Windows Media Center have included a libraries function to make media access easier, it worked only within the WMC interface. Windows 7 is the first Windows version to bring libraries to the Windows Explorer.

What Is a Library?

A library is a logical folder that can display the contents of multiple physical locations at the same time: in other words, as if the contents were stored in the same physical folder. When you open Documents, Pictures, Music, or Videos shortcuts from the Windows 7 Start menu, you are opening the current user's Documents, Pictures, Music, or Videos libraries. Here's a portion of the Documents library on one of my Windows 7 systems:

At first glance, it looks about the same as the Windows Vista Documents folder. However, note that under the Documents library title that there are two locations in this library. That's two folders visible at the same time.

Accessing Your Personal Folders

If you prefer to view only the contents of your personal folders, open the Start menu and click your name. The folders in the main pane are your personal folders:

Default Library Locations

To find out which folders are included in a library, open the library and click the locations link, or hover your mouse over the locations link. For example, if you have the Documents library open, the link opens the Documents Library Locations dialog:

By default, Windows 7 uses the following locations for each user's libraries (assuming C:\drive is used as the system drive):

Documents library:

C:\Users\username\Documents* (My Documents)

C:\Users\Public\Documents (Public Documents)

Music library:

C:\Users\username\Music* (My Music)

C:\Users\Public\Music (Public Music)

Pictures library:

C:\Users\username\Pictures* (My Pictures)

C:\Users\Public\Pictures (Public Pictures)

Videos library:

C:\Users\username\Videos* (My Videos)

C:\Users\Public\Videos (Public Videos)

*The default save location - if you don't specify a different location, saving a new or edited file to the library will save the file to this location.

By placing the Public folders in each library by default, Windows 7 makes it easy to for users to see the files they're sharing with other users. By default, Windows 7 libraries use the By Folder view, which enables you to see at a glance the files in each shared folder. In this example, the Videos library includes four locations, and you can see some of the contents of two of the locations:

To view all of the folders in a library, you can also expand the library in the left pane of Windows Explorer:

Because libraries are displayed in the left pane of an Explorer window, you can access them the same way you'd access personal folders, local drives, mapped drives, and network folders.

Adding a Local Location to a Library

There are two methods you can use to add a local folder or drive to a library:

Method 1:

1. Open the library.
2. Click the Locations link. Current locations are listed.
3. Click Add :

4. Navigate to the location you want to add to the library.
5. Click Include Folder :

6. The folder is added to your locations.

Method 2:

1. Open Windows Explorer, Computer, etc.
2. Navigate to the location.
3. Select the location to use.
4. Click Include in Library :

5. Select the library to use.
6. The location (which can be a folder or a drive) is included in the library.

Library Limitations: No Removable Drives

Windows 7's library feature is designed to work with folders on local hard disks, either internal or external. It cannot be used with removable-media drives or USB flash drives, as this error message shows:

Workarounds for Network Library Errors

A different error message is displayed if you attempt to add a network share to one of your libraries:

If the library function doesn't work with network shares, this would be a big problem. If you're like me, you might have one or more network shares that contain files you'd like to access easily. So, what can you do? Note that Microsoft says that the problem is that the folder is not indexed.

When you click the "How Can This Folder Be Indexed?" link, for help, Microsoft suggests three solutions. Which one's the best for you, or are there even better ways to add network shares to your libraries? Let's find out.

Option Number 1: HomeGroup

Make sure your computer and the remote computer are in the same homegroup. This method works:

There's just one catch, though: You can use the HomeGroup technology in Windows 7 only with other Windows 7 PCs .  Most of us need a method that also works with older Windows versions.

Option Number 2: Make sure the remote folder's contents are indexed

It would seem logical that if you're running Windows Search 4.0 on the remote computer that its index would be usable for this purpose. However, you'd be wrong. Unfortunately, the only way to make sure those files are indexed is to try the third option - if you're using a version of Windows 7 that supports it .

Option Number 3: Use the Offline Files feature in Windows 7 Professional, Enterprise, and Ultimate editions

To set up offline files, right-click the network share and select Always Available Offline:

Windows 7 uses Sync Center to make synchronized copies of the share's contents to your computer, and resynchronizes them when either the original or copy changes and the computers are connected. This method works (the green SyncCenter icon indicates an offline folder):

Unfortunately, there are a couple of problems with this feature too: The first one is that if you're opting for Windows 7 Home Premium, you don't have Offline Files support. Secondly, this option is useful primarily for mobile users who are not always connected to the shared resource. It is not practical for full-time network access or for situations in which the resource has a lot of files, as the sync process could take a long time and uses up disk space on your local drive. Is there are better way?

Adding a Network Folder to a Library with Symbolic Links

Symbolic links (which enable you to access the contents of a drive letter or network location through an empty folder), a long-time Unix and Linux feature first introduced to Windows with Windows Vista , provide an easy way to add a network share to your library without the need to sync its files to your local hard disk - if you don't mind a bit of cheating.

Both Windows 7 and Windows Vista create symbolic links the same way by using the command-line mklink tool. Here's how to use Mklink and a little misdirection of the Libraries feature to make a symbolic link that your library can use:

1. Create an empty folder to store the link in your preferred location. In this example, I created an empty folder called Netlink in C:\Users\Marcus\:

2. Add the new folder to your library:

3. Open Windows Explorer and delete the folder.

4. The location remains in the libraries dialog:

5. To create a symbolic link, open a command prompt as administrator:

6. Enter a command with this syntax:

mklink /d locallink \\remotelink

If you see a message similar to this one, you've created the symbolic link:

Symbolic link created for locallink <<===>> \\remotelink

7. Type Exit and press Enter to close the command prompt session.

8. Open the library, and you should see your photos in the remote folder:

(I learned about this method from a posting on the Sevenfourums website and a free video (with registration) available at the Winstructors website)

Dealing with File and Folder Names with Spaces

One problem with the demonstrations of this method online showed up when I tried to use this method to link to a share called
\\TIGER-ATHLON\MaximumPC\Web Articles 2009\Win7 Feature Focus\Using Win7 Photo Features\Figures :

C:\Users\Marcus> mklink /d c:\users\marcus\netlink \\TIGER-ATHLON\MaximumPC\Web A
rticles 2009\Win7 Feature Focus\Using Win7 Photo Features\Figures

The syntax of the command is incorrect .

What was wrong? After I tried this a few times, I realized what the problem was. Every example I'd seen online involved pathnames without spaces. However, the odds are good that either your local folder or remote path will have spaces. The solution? Use quote marks around the pathname that contains spaces:

C:\Users\Marcus> mklink /d c:\users\marcus\netlink "\ \TIGER-ATHLON\MaximumPC\Web
Articles 2009\Win7 Feature Focus\Using Win7 Photo Features\Figures"

This time, I got the results I wanted:

symbolic link created for c:\users\marcus\netlink <<===>> \\TIGER-ATHLON\MaximumPC\ Web Articles 2009\Win7 Feature Focus\Using Win7 Photo Features\Figures

If the need to use quote marks seems puzzling to you, right-click on any desktop or start menu shortcut to a program or file with spaces in the name, and select Properties. Look at the target, and you'll see that the shortcut command line has quote marks around it, as in this example for Apple's QuickTime Player:

When you open the folder that contains the symbolic link you used for the library, you will note that the link uses the shortcut arrow icon. Right-click the icon and select Properties to view the properties for the link:

Removing a Folder from a Library

At some point, you might decide that you no longer need to view the contents of a particular location as part of a library. To remove the location, open the library, open the Locations dialog, select the location, and click Remove . The files in the location are not affected, but are no longer displayed in the library.

Note: If you delete the shortcut on your local system to the symbolic link, you will need to use the command-line mklink program to recreate the link.

Working with Libraries

You can perform about any file operation you need to with a library, as long as you have sufficient rights to the location. For example, you can delete a file from the library view if it's on your local system or you have read/write access to the shared location.

By changing views, you can see the files in each of your libraries in the most effective ways for your purposes. In this example, I selected the Month view for my Pictures library:

By (File) Type for my Documents library:

By Album for my Music library:

Creating a New Library

Although Windows 7 includes only four libraries by default, there's no reason not to have more. To create a new library:

1. Open the libraries view.

2. Click New Library :

3. Name the library. In this example, I'm creating a library for games:

Once you create a library, use the methods covered earlier in this article to add locations to the library. Remember, you can choose a particular folder, an entire non-removable local drive, or a network location.

Benefits of Libraries

If you're sick and tired of hopscotching around your system to find media or other types of files, Windows 7's Libraries feature will save your aching mouse finger.

If you're looking for an easy way to make frequently-used local or network locations accessible without constantly navigating to them, Libraries solves your problem. Virtually anything you can do with a folder you can do with libraries, and best of all, you can choose when to work at a folder level and when to work at a library level.

Hit Comment and tell us your favorite library tips and tricks!

Mark Edward Soper has spent a lot of time with Windows 7, and his forthcoming book Easy Microsoft Windows 7 proves it. He's also found time for his favorite hobby, digital photography, and his new book, The Shot Doctor: The Amateur's Guide to Great Digital Photos , will help you take better pictures this summer and throughout the year, whether you use a point-and-shoot or digital SLR camera.

Around the web

by CPMStar (Sponsored) Free to play

Comments