Note: This article is adapted from Windows 7 Secrets Chapter 5: Where's My Stuff? Finding and Organizing Files --Paul

Most readers are probably familiar with basic computer file system concepts like files, folders, and drive letters. But you may not realize that certain locations in the Windows shell?that is, Windows Explorer, the application with which you literally explore the contents of your PC?s hard drives?have been specially configured to work with particular data types and live in the shell hierarchy outside of their physical locations. In previous Windows versions, these locations were called special shell folders, and they included such things as My Documents, My Pictures, and My Music.

In Windows 7, these special shell folders still exist, sort of, but now they are just normal folders that can be found inside of your user folder (typically at C:\Users\your user name). You can still manually copy documents to My Documents, as you did in Windows XP, and copy pictures to My Pictures. But in Windows 7, the old special shell folders aren't particularly accessible because they've been effectively replaced by something called Libraries.

Tip: To see the folders contained within your user folder in Windows 7, open the Start Menu and select your user name on the top right. The Explorer window that opens displays the contents of your user folder.

So instead of the My Documents folder, you'll typically access the Documents library. The My Pictures folder has been replaced by the Pictures library. And so on. Libraries are virtual folders, a concept that was first introduced to Windows, meekly, in Windows Vista. But in Windows 7, Libraries, and, thus, virtual folders, are central to the entire shell and user experience. So before moving on any further, let's step back for a second and explore virtual folders first.


Virtual Folders 101

Early in the several-year development lifecycle of Windows Vista, Microsoft began talking up a new file management system that would be based on a new user interface construct called a virtual folder. As the name suggests, virtual folders are a special kind of folder, one that does not actually represent a physical contain in the file system like a "real" folder. You may recall that the constructs we call folders and special shell folders do, in fact, correspond to discrete locations in the shell namespace. That is, they are what we might call real or physical folders.

Virtual folders are not the same as real folders. They're not even really folders at all, though they do appear to contain files and folders. Actually, virtual folders are files that describe (or appear to contain) symbolic links, or shortcuts, to real files and folders. And the way that virtual folders are created might surprise you: They?re really just the physical embodiment of a file search. That?s right: Virtual folders contain search query results, presented in a way that is virtually (ahem) indistinguishable from the display of a real folder.

I know. It sounds confusing. But in day to day usage, virtual folders work almost exactly like regular folders. I'll describe the differences--and the very real advantages of Libraries--in just a moment.

Libraries and Windows 7

OK, enough background. Let's see what's changed with regard to user folders, Libraries, and special shell folders. The first thing to understand is that while your typical special shell folders--My Documents, My Music, My Pictures, and My Videos--still exist in Windows 7, inside of your user folder, you will rarely need or want to access them directly. Instead, you will work with the content types stored in these folders via Windows 7's new Libraries.

Think about how you might typically access My Documents in Windows XP: There's a very handy My Documents link right there in the Start Menu. (In Windows Vista, it was confusingly called Documents.) Well, Windows 7 has a Documents link in the Start Menu too. But when you click on that link the window that opens displays the Documents library, not the (My) Documents folder, as was the case in previous versions. Ditto for Pictures, Music, and Videos.

Secret: Yes, you read that right: For the first time, you can link to your Videos library directly from the Start Menu. It's not enabled by default however. If you'd like to turn this access on, right-click on the Start button, choose Properties, and then click the Customize Button in the Taskbar and Start Menu Properties window that appears. Scroll down the list in the Customize Start Menu window that appears until you find Videos (it's at the very bottom). Then choose Display as link or Display as a menu. Voila.

Each of the built-in Libraries in Windows 7 can be quickly accessed via the Windows Explorer shortcut that's pinned to the taskbar. When you click this shortcut, the Libraries view opens in Windows Explorer, as shown below.

Windows 7 Feature Focus: Libraries
Windows 7 Libraries.

Secret: So what is this Libraries window? Where does that thing exist? As it turns out, the Libraries folder can be found at C:\Users\your user name\AppData\Roaming\Microsoft\Windows\Libraries, which is hidden by default. Like special shell folders from Windows past, the Libraries folder is really just a special location in the shell namespace and is there for your convenience. In addition to the pinned tray shortcut, you can access this folder any time, in any Windows Explorer window, by clicking the Libraries link in the navigation pane.

Because Libraries aren't really folders, there are a few additional concepts to understand about this change: Yes, Libraries do effectively replace special shell folders in that you will access them from the Windows Start Menu. And yes, when you save and open files via virtually any application, you'll do so via the various Libraries that Windows 7 provides. There's just one thing: These Libraries aren't real places. In fact, they're simply files themselves, files that describe the contents of a thing that is presented to the user ... as a folder. Or something like a folder. Something better than a folder.

Here's how Libraries are different, from a usage standpoint.

Libraries look different than folders. If you compare a typical Library window and a typical folder window side-by-side, you'll see a few subtle but important differences. Libraries include a header area that lists the name of the library and links for Includes and Arrange by, as shown here.

Windows 7 Feature Focus: Libraries
Libraries include a header area that's not seen in, and not available to, normal folders.

These links provide access to additional Library functionality that we'll discuss in just a moment. But as important as the UI difference is, it's equally important to understand that the header area you see in a Library is available continuously as you drill down into the folders it "contains." You won't see this header--or gain access to its functionality--if you access the same shell locations via normal folders.

Libraries are collections. By default, each of the four Libraries that ship with Windows 7--Documents, Music, Pictures, and Videos--collects, or aggregates, content from two physical locations on your hard drive and displays them in a single location. For example, the Documents library collects content from your My Documents folder (C:\Users\your user name\My Documents) and the Public Documents folder(C:\Users\Public\Public Documents). You are free to add and remove the folders that a library monitors for content.

Secret: If you're familiar with Windows Media Center or Zune, you may recall that these applications use a system called monitored folders to watch, or monitor, folders in the file system for new or changed files. The system used by Windows 7's Libraries is functionally identical. If anything changes in a physical folder that is being monitored by a Library, that change will be reflected in the Library.

To view or modify the folders that are monitored by a Library, click the link next to Includes in the Library header, which, by default, will read as 2 locations. As you can see in the figure below, the resulting Locations window lists the shell locations that are monitored by the Library, has an Add button for adding new locations to monitor, has a Remove button for removing monitored locations, and references something called the default save location, which we will discuss next.

Windows 7 Feature Focus: Libraries
You can configure individual Library behaviors via the Locations window.

Libraries support a default save location. Because Libraries are not really folder locations, and because they can monitor multiple folder locations, you need some way of knowing what happens when you save a file or folder to a Library. That is, where does it go? What happens to it?

Each default Library--Documents, Music, Pictures, and Videos--uses the appropriate special shell folder inside of your user folder as its default save location. So for the Document folder, the default save location is My Documents. For Pictures, it's My Pictures. And so on. This makes plenty of sense, and its certain easy enough to handle when you're just using the two default monitored folder locations for each Library.

Things can get a little more complicated when you start monitoring folders on different drives or on remote network locations. Both of these are possible, but doing so introduces some a few twists. Consider simple file copy operations. When you drag a file from folder to folder on the same drive, Windows uses a move operation by default. But when you drag and drop from drive to drive, or across the network, the file is copied, not moved. These different file operations will occur within your Libraries too, if the monitored folders in question are located off of the main hard drive. It's something to think about.

Windows Media Player and other applications utilize Libraries. In previous versions of Windows Media Player, you could set up the file locations the player would use to monitor for content. That's no longer the case in Windows Media Player 12. Now, the player simply utilizes the Music, Pictures, and Videos libraries for content. While some other Windows 7 applications also utilize Libraries, some do not (at least not yet). Windows Live Photo Gallery, for example, still uses a pre-Library folder monitoring system of its own, for example.

[ Read how Microsoft's Zune 4.2 software now uses Libraries as well. ]

Libraries are the basis for Windows 7's network sharing capabilities. In previous versions of Windows, you had to explicitly share folders so that they could be accessed by other PCs and compatible devices across your home network. Windows 7 makes this much easier with a new feature called HomeGroups. Four of the five objects that Windows 7 shares via HomeGroups--pictures, music, videos, and documents--are shared via Libraries. (The fifth shared object, printers, is of course separate.) Yes, you can still share things the old fashioned way if you want, but Libraries, combined with HomeGroups, make sharing easier than ever, if you're on a home network.

You can arrange Library views in ways that aren't possible with folders. While Libraries support the Sort by and Group by options utilized by folders, they also offer a unique visualization option called Arrange by that is not offered to traditional folders.

To understand how this functionality is exposed in the UI, check out the figure below. Here, you can see two windows, side-by-side. On the left is a sub-folder in the Pictures library. And on the right is the same sub-folder in the current users' My Pictures folder. See the difference?

Windows 7 Feature Focus: Libraries
Library windows (like that on the left) offer a few advantages over standard folders.

OK, enough guessing games. As mentioned above, Libraries have an additional panel at the top of the window, below the toolbar, that provides access to two crucial Library features. The first, Library Locations, lets you determine which physical folders are monitored to create the current Library view. However, the second feature, Arrange by, is what we're concerned with at the moment.

Arrange by provides a number of options, but what you'll see will differ according to which Library you're viewing. All of them use "Arrange by Folder" as the default choice, however, and in this arrangement, a Library will display just like any other folder.

If you choose one of the other arrangements, however, the Library will change into the Stack view that was first used in Windows Vista. Stacks represent files as visual stacks of paper, much like stacks of paper might be arranged on a real desk. (Yes, Microsoft is taking the PC's desktop metaphor a bit far these days.) To better understand what this means, take a look at the figure below. In this figure, you can see the Music library arranged by Artist.

Windows 7 Feature Focus: Libraries
The Music library, arranged by Artist.

And if you arrange the Pictures library by Month, it should resemble this next shot. Neat, eh?

Windows 7 Feature Focus: Libraries
Library arrangements look best when the content is very visual, like pictures.

Tip: As with Sort by and Group by, you can also access Arrange by if you right-click an empty area of a Library window. Note, however, that this option will only be available in Libraries. You won't see an Arrange by option in the pop-up menu that appears in regular folder windows.

But wait, there's more...

There's much more going on with Libraries in Windows 7, but you'll have to check out Windows 7 Secrets for the rest, including the history of virtual folders, special shell folders in Windows 7, where Microsoft moved Windows XP and Vista shell features in Windows 7, creating custom libraries, and using saved searches . The book is available now from Amazon.com and other booksellers. Click here to find out more about Windows 7 Secrets.