programming4us
programming4us
DESKTOP

Windows 7 : Understanding Libraries (part 1) - Virtual Folders 101, Libraries and Windows 7

1/16/2014 12:23:37 AM

Most Windows 7 Secrets 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 personal 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.

To see the folders contained within your home folder in Windows 7, open the Start menu and click your user name on the top right. The Explorer window that opens displays the contents of your personal folder.


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. As Libraries, and, thus, virtual folders, are central to the entire shell and user experience, we want to step back for a second and explore virtual folders.

1. Virtual Folders 101

Early in the several-year development life cycle 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 container 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.

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

Virtual Folders—A Short History Lesson

In order to truly understand virtual folders, it's important to first understand the thinking that went into this feature. And since this is a feature that was originally scheduled for the ever-delayed Windows Vista, it might also be helpful to know about Microsoft's original plans for the Vista shell and virtual folders and compare the plans with what eventually happened.

Microsoft originally envisioned that it would not include in Vista a traditional file system with drive letters, physical file system paths, and real folders. Instead, the software giant wanted to virtualize the entire file system so that you wouldn't need to worry about such arcane things as "the root of C:" and the Program Files folder. Instead, you would just access your documents and applications, without ever thinking about where they resided on the disk. After all, that sort of electronic housekeeping is what a computer is good at, right?

This original vision required a healthy dose of technology. The core piece was a new storage engine called WinFS (short for Windows Future Storage), which would have combined the best features of the NTFS file system with the relational database functionality of Microsoft's SQL Server products. As of this writing, Microsoft has been working on WinFS, and now its successors, for about a decade.

There was just one problem: the WinFS technology wasn't even close to being ready in time for Windows Vista, so Microsoft pulled WinFS out of Vista and began developing it separately from the OS. Then, it completely cancelled plans to ship WinFS as a separate product. Instead, WinFS technologies would be integrated into other Windows versions—including Windows 7—and other Microsoft products.

Even though WinFS was out of the picture, Microsoft figured it could deliver much of that system's benefits using an updated version of the file system indexer it has shipped in Windows for years. And for about a year of Vista's development in 2004–05, that was the plan. Instead of special shell folders like Documents, users would access virtual folders such as All Documents, which would aggregate all of the documents on the hard drive and present them in a single location. Other special shell folders, like Pictures and Music, would also be replaced by virtual folders.

Problem solved, right? Wrong. Beta testers—who are presumably more technical than most PC users—found the transition from normal folders to virtual folders to be extremely confusing. In retrospect, this should have been obvious. After all, a virtual folder that displays all of your documents is kind of useful when you're looking for something, but where do you save a new file? Is a virtual folder even a real place for applications that want to save data? And do users need to understand the differences between normal folders and virtual folders? Why are there both kinds of folders?

With the delays mounting, Microsoft stepped back from the virtual folder scheme, just as it had when it stripped out WinFS previously. Therefore, the file system that appeared in Windows Vista was actually quite similar to that in Windows XP and previous Windows versions. That is, the file system still used drive letters, normal folders, and special shell folders like (My) Documents and (My) Pictures. If you were familiar with any prior Windows version, you would feel right at home in the Vista shell. (Likewise, if you found the Windows file system to be a bit, well, lackluster, all the same complaints still applied in Vista as well.)

There was, however, one major difference between Vista's file system and that of previous Windows versions, and this difference has been made central to the Windows 7 file system. Even though Microsoft had temporarily decided not to replace special shell folders with virtual folders in Windows Vista, the company still shipped virtual folder technology in the OS. The idea was that users could get used to virtual folders, and then perhaps a future Windows version would simply move to that system, and eventually we'd reach some "nerdvana" where all the silly file system constructs we use today were suddenly passé.

That nerdvana, arguably, has arrived in Windows 7. No, Microsoft hasn't relegated drive letters and physical folders to the dustbin of history, at least not yet. But they have implemented one of the early Vista file system plans in Windows 7: now, traditional special shell folders (but not the entire file system) have been replaced by virtual folders. This time around they're called Libraries.


2. Libraries and Windows 7

Okay, enough background. It's time to 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 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.

NOTE

Yes, you read that last sentence 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 enable this access, 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 in Figure 1.

Figure 1. Windows 7 Libraries

NOTE

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 username\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 at 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 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.

NOTE

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.

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 in Figure 2.

    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 username\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.

    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 two locations. As shown in Figure 3, the resulting Locations window lists the shell locations 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.

    Figure 2. Libraries include a header area that's not seen in, and not available to, normal folders.

    NOTE

    You may want to add a network share to the list of locations as well. While this is certainly possible, and recommended, there's a catch. The device or server housing this share must index, or catalog, the files within and provide results to Windows 7 clients on-demand. While this requirement can easily be met on a Windows platform by installing Windows Desktop Search, you may run into difficulties with other non-Windows devices.

    Figure 3. 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. For example, 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 it's 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.

  • 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.

  • 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.

Other  
  •  Windows Server 2012 MMC Administration (part 11) - Designing custom taskpads for the MMC - Creating navigation tasks, Arranging, editing, and removing tasks
  •  Windows Server 2012 MMC Administration (part 10) - Designing custom taskpads for the MMC - Creating and managing tasks
  •  Windows Server 2012 MMC Administration (part 9) - Designing custom taskpads for the MMC - Creating and managing taskpads
  •  Windows Server 2012 MMC Administration (part 8) - Designing custom taskpads for the MMC - Getting started with taskpads, Understanding taskpad view styles
  •  Windows Server 2012 MMC Administration (part 7) - Building custom MMCs - Setting the console icon before saving, Saving the console tool
  •  Windows Server 2012 MMC Administration (part 6) - Building custom MMCs - Setting the console mode before saving
  •  Windows Server 2012 MMC Administration (part 5) - Building custom MMCs - Adding snap-ins to the console
  •  Windows Server 2012 MMC Administration (part 4) - Building custom MMCs - Creating the console
  •  Windows Server 2012 MMC Administration (part 3) - Using the MMC - MMC tool availability
  •  Windows Server 2012 MMC Administration (part 2) - Using the MMC - MMC window and startup
  •  
    GTS - youtube channel
    video
     
    Video tutorials
    - How To Install Windows 8

    - How To Install Windows Server 2012

    - How To Install Windows Server 2012 On VirtualBox

    - How To Disable Windows 8 Metro UI

    - How To Install Windows Store Apps From Windows 8 Classic Desktop

    - How To Disable Windows Update in Windows 8

    - How To Disable Windows 8 Metro UI

    - How To Add Widgets To Windows 8 Lock Screen

    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010
    programming4us programming4us
    programming4us
     
     
    programming4us