Windows Vista virtual folders

an article added by: Jonathan Bright at 06022007


In: Categories » » Windows Vista » Windows Vista virtual folders

Virtual Folders - A Short History Lesson Let’s step back a bit before diving too deeply into potentially confusing territory. In order to understand Vista’s virtual folders, it’s important to first understand the thinking that went into this feature. And since this is the ever-delayed Windows Vista we’re talking about, 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. You see, 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, and not ever think 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 of this technology 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 its predecessors, 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 will be integrated into future Windows versions 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 folder Problem solved, right? Wrong. Beta testers 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. So the file system you see in Windows Vista is actually quite similar to that in Windows XP and previous Windows versions. That is, the file system still uses drive letters, normal folders, and special shell folders like Documents and Pictures. If you’re familiar with any prior Windows version, you should feel right at home in the Vista shell. There’s just one major difference, although it’s not particularly obvious. Even though Microsoft has decided not to replace special shell folders with virtual folders in this release, the company is still shipping virtual folder technology in Windows Vista. The idea is that users will get used to virtual folders now, and then perhaps a future Windows version will simply move to that system, and eventually we’ll reach some nerdvana where all the silly file system constructs we use today are suddenly passé. So virtual folders are somewhat hidden in Windows Vista. That makes them a power user feature and, for readers of this article, inherently interesting. Most people won’t even discover virtual folders and their contained shared searches. In fact, if you want to harness some of the most awesome technology in Windows Vista, this is the place to start. And heck, the skills you learn now will give you a leg up when Microsoft finally gets around to retiring the current file system. It’s only a matter of time.

Understanding Search Folders Search Folders contain the saved results from a search query. They are built using Vista’s indexing engine and stored in an XML file format that developers will be able to easily access, modify, and extend. There are two types of saved searches: Those that are built into the system itself and are thus exposed in the shell and those that you build yourself. In the following sections, we’ll examine both kinds of saved searches.

Using Prebuilt Search Folders Microsoft provides a small number of useful saved searches for you, and they’re available as soon as you begin using Windows Vista. There are two ways to discover these saved searches: You can open an Explorer window, which contains a single search folder, called Recently Changed, in its navigation pane. Navigate to the Searches folder, a copy of which is found in each user’s Home folder (typically C:\Users\username\ Searches). Although Search Folders appear and act like normal folders, they are actually specially formatted XML files that use a

.search file extension. So the Search Folder named Attachments is actually a file named

Attachments.search. If you’d like to edit one of these saved searches, simply right-click it in the shell and choose Open With and then Notepad.

DANGER: Be careful not to leave the check box named Always use the selected program to open this kind of file checked (selected), however. If you do that, your Search Folders will revert into normal text files and won’t work properly any more.

Looking at the Code for a Search Folder Take a look behind a typical Search Folder called Shared By Me. If you open this saved search in a text editor like Notepad, you’ll see that it’s composed of XML code, as shown in Listing 5-1.

Listing 5-1: Example Source Code  from a Saved Search
<?xml  version=”1.0”?>
<persistedQuery version=”1.0”>
<viewInfo  viewMode=”details” iconSize=”16”>
<visibleColumns>
<column  viewField=”System.ItemNameDisplay”/>
<column  viewField=”System.DateModified”/>
<column  viewField=”System.Keywords”/>
<column  viewField=”System.SharedWith”/>
<column viewField=”System.ItemFolderPathDisplayNarrow”/>
</visibleColumns>
<frequentlyUsedColumns>
<column  viewField=”System.Author”/>
<column  viewField=”System.Kind”/>
<column  viewField=”System.Size”/>
<column  viewField=”System.Title”/>
<column  viewField=”System.Rating”/>
</frequentlyUsedColumns>
<sortList>
<sort  viewField=”System.SharedWith” direction=”descending”/>
</sortList>
</viewInfo>
<query>
<conditions>
<condition  type=”andCondition”>
<condition  type=”leafCondition” property=”System.IsShared”
operator=”eq” value=”true”/>
<condition  type=”leafCondition” property=”System.FileOwner”
operator=”eq”  value=”[Me]”/>
</condition>
</conditions>
<kindList>
<kind name=”item”/>
</kindList>
<scope>
<include  knownFolder=”{5E6C858F-0E22-4760-9AFE-EA3317B67173}”/>
<include knownFolder=”{DFDF76A2-C82A-4D63-906A-5644AC457385}”/>
</scope>
</query>
</persistedQuery>

You don’t have to be a programming guru to understand what’s going on here. There are a few main parts to the saved search file:

viewInfo (which  includes a single subpart called
sortList) and
query, the latter of which  includes the
scope and
visibleInList subparts.
    The
sortList subpart in the
viewInfo part  clearly defines how the saved search will be displayed:
    By date modified in  descending order. The
scope subpart inside the
query part  is
    interesting: It specifies  three folder locations that this query will search. Those huge
    strings of letters and  numbers are known as a Globally Unique Identifier (GUID). The
    idea is that each GUID  identifies a unique location. When you create your own Search
    Folders (see later in this article),  one or more scope subparts will be used, and will be
    filled with normal shell  location strings, such as C:\Users\Jan.

Editing a Search Folder If you’re an XML expert, it’s possible to hand-edit any saved searches, including the ones that Microsoft ships with Windows Vista. However, this isn’t necessarily a great idea unless you really know what you’re doing. Any text editor, including Notepad, will let you change the contents of a saved search in addition to simply letting you view them.

Creating Your Own Search Folders Although the built-in saved searches can be handy, the real power of these virtual folders is that you can make your own. As you use Windows Vista, you may find yourself occasionally performing the same search over and over again. If that’s the case, you can simply save the results as a Search Folder, which you can then access later as if it were a normal folder. Like the built-in Search Folders, any Search Folder that you create yourself is dynamic, meaning that it can change every time you open it (and cause its underlying search query to run). For example, if you create a Search Folder that looks for all Microsoft Word (*.doc and

*.docx) files, you may produce a search results list in which there are 125 matches. But if you add a new Word document to your Documents folder and re-open the Search Folder, you’ll see that you now have 126 matches. The point here is that Search Folders aren’t static, and they don’t cease being relevant after they’re created. Because they literally re-query the file system every time they’re run, saved searches will always return the most up-to-date possible results.

Searching for Files To create a Search Folder, you must first search your hard drive for some kind of file. In a simple example, you might simply look for any files on your hard drive that contain your full name. To do so, launch Windows Vista search by choosing Search from the Start menu. Searching is context sensitive. If you bring up the Search tool as described before, Windows Vista will search the most common locations that documents might be stored in the file system. However, if you use the Search box in any Explorer window, Vista will search only the current folder (and its subfolders). In the Search window, select the Search box in the upper-right corner of the window and begin typing your search query. As you type, Windows Vista queries the index of files contained on your hard drive and returns results in real time. This feature is called as-youtype- search or word-wheeling. Contrast this with most search tools, in which you type a search query and then press Enter or a user interface button in order to instantiate the actual search. The reason Vista performs search queries as you type is that the information it’s looking for is instantly available: On a typical PC, there’s no performance penalty. As Vista displays the search results, a green progress bar will throb through the Search window’s address bar. When the query has completed, the progress bar will disappear. Although you’re probably familiar with file and folder searching using the Find function in previous Windows version or a third-party tool like Google Desktop or MSN Desktop Search, you may not be familiar with some commonly used wild card characters, which can help fine-tune your searches. For example, the character * stands for one or more letters, whereas the ? character is used to represent any one letter.

Filtering the Search Results A search query that is as general as your name can result in hundreds of hits, so it’s more useful to filter the search results down a bit to make the search more specific. You do this by using the Show Only toolbar in the Search window. Here, you can specify which file types you’d like to search - All, E-mail, Documents, and some others. By default, Search will search the entire computer, but you can also force it to search all drives and devices, the current user’s Home folder, or you can specify exactly where to search. For that, however, you’ll need to access Advanced Search, as denoted by the button on the right of the toolbar. We’ll get to that in just a bit. When you specify a file type, such as Document, the search results list is trimmed down, often significantly, 5-7. But what happens when you want to display results that include two or more file types or perform more powerful searches? At the right side of the Show results for toolbar is the Advanced Search button. Click this button, which resembles a downward pointing arrow, and you’ll be presented with the Advanced Filters pane, in which you can specify more filter types or specify another file type for which to search.

Saving a Search After you’ve created a search, especially a fairly complicated one that you may need to repeat in the future, it’s a good idea to save it. Curiously, there’s no obvious way to do this, unless you’ve enabled the Classic Menu. To save a search, type Alt+F to bring up the menu, and then select Save Search. This displays a standard Save As dialog box, where you can provide a name for your saved search. By default, saved searches are saved, naturally enough, to your Searches folder, but you can change the location if you’d rather save a search to your desktop, Documents folder, or other location. You can also drag any saved search over to the Favorite Links section of the navigational pane in Windows Explorer so you can access it easily later.

Configuring Search Options For performance reasons, Windows Vista only indexes the Users folder (and all subfolders, including each user’s Home folder) and certain other locations (like Offline Files) so that when it performs file searches, the results are returned quickly. However, you can change the default indexing locations if you’d like. For example, maybe you prefer saving documents and other files to a specific hard drive or partition. In such a case, it would make sense to ensure that Vista is indexing that location as well. To configure the way Windows Vista indexes and searches, you need to locate the Indexing and Search Options tool, which is found in Control Panel -> System and Maintenance. Shown in article 5-9, this tool enables you to include or exclude shell locations from indexing. The Advanced button is particularly useful. Here, you can determine whether Vista indexes encrypted files, which file types are indexed, and where the index is stored. If you want the absolute best performance, consider moving the index to your fastest hard drive. To do this, open Indexing and Search Options and click the Advanced button.

Summary Microsoft may have removed its WinFS technology from Windows Vista, but you’d never know it based on the amount of searching technologies that are still built into this system. The integrated search functionality in Windows Vista is a huge improvement over Windows XP, with numerous entry points in the OS, including the Start Menu and every Explorer window, and intelligent results based on where the search was instigated. Best of all, the Windows Vista search functionality includes one of the system’s best power-user features: The ability to save searches as dynamic virtual folders you can access again and again as if they were normal shell folders.

legal notice

Our website is not responsible for the information contained by this article. Web-articles is a free articles resource.
Suggestion: If you need fresh, daily updated content for your website, feel free to use our service. Click here for more information.

Useful tools and features

Link to this article from your page    Send this article to you or to a friend
If you like this article (tutorial), please link to it from your web page using the information above.

related articles

1. The Vista Upgrade Advisor
For those who want to upgrade a Windows XP machine to Vista, starting with the Vista Upgrade Advisor is a good first step. Getting Ready for the Upgrade Advisor When you start the Upgrade Advisor from Microsoft’s site, a small application is downloaded to your PC. The advisor is designed to test two different kinds of hardware compatibility: Whether your hardware is fast enough and modern enough to run Vista satisfactorily _ Whether your device drivers are compatible with Wi...

2. Aero and Windows Vista
The Value of Vista We waited more than five years for Vista. As you may recall, Windows XP was released with much fanfare in October 2001. But instead of the next Windows version shipping in just a couple of years, as originally expected, Microsoft lost its way in the development process. Vista didn’t make it to consumers until early 2007. Was it worth the wait? The short answer is, “Yes.” We believe Vista is a major advance on Microsoft’s previous operating s...

3. Windows Vista Put Some Gadgets in Your Windows Sidebar
Apple users have long been able to take advantage of the Mac OS X Dashboard, and Windows users have been able to download Yahoo Widgets (formerly Konfabulator Widgets). Those things are still available, but now Vista has its own little tools, known as gadgets. Vista gadgets live in the new Windows Sidebar which you can move to the left or right side of the screen by right-clicking it and selecting Properties. Or you can put Gadgets on your Desktop by dragging the little context menu that appears when you hover ...

4. Support for RSS News Feeds in Windows Vista
IE 7.0 includes an easy way to subscribe to news feeds, regularly updated information that sites publish in the format known as Really Simple Syndication (RSS). When a surfer visits a site that publishes one or more news feeds, a square broadcast icon on IE 7’s toolbar changes from grey to orange. Clicking the icon takes you to a page that explains the content of a feed and provides a clickable link that subscribes you. This is a big improvement over previous news feed buttons in other browsers, which formerly ...

5. Thinking of Cheating at Solitaire in Windows Vista
Unfortunately, Vista new Solitaire code seems to have broken one way that neerdowells have cheated at the game for years. This scandalous behavior was first revealed in Windows 3 s all the way back in 1991. As that article explained it, you could click Game - Undo when playing a Draw Three game, and the last three cards you turned over from the deck would go back on the pile. If you then held down the Shift key while clicking the deck, only one card at a time would turn over, allowing you to ...

6. A Quick Overview of All the Versions of Windows Vista
It seems like Windows Vista has a lot more versions than Microsoft has ever offered before. But that isn’t quite true. The Redmond company years ago split Windows XP into almost as many versions as we have today with Vista. You may occasionally hear Vista’s versions referred to as SKUs. This term stands for Stock Keeping Unit. We’ll use the more common terms version and product version throughout this article instead. Here’s a review of the major Windows XP versions (rough...

7. Taking Advantage of Your Ability to Upgrade to Windows Vista
Windows Anytime Upgrade Unlike previous versions of Windows, Vista installs itself with the capability to upgrade from a weaker version to a more-capable version at any time. You simply run the Anytime Upgrade applet, select a source to purchase an upgrade license from, and your PC is quickly enhanced with the more powerful version you’ve selected. _ Vista Home Basic can be upgraded in this way to Home Premium or Ultimate. _ Vista Home Premium and ...

8. Deploying Windows Vista: A Power User`s Toolkit
If you’re an enterprise administrator faced with the prospect of rolling out Windows Vista to hundreds or thousands of desktops around the world, take heart: Microsoft has finally upgraded its deployment tools in dramatic fashion, taking advantage of the componentized architecture of Windows Vista. But these deployment tools aren’t just advantageous to the world’s biggest corporations. If you’re a power user, a tinkerer, or someone who ends up having to reinstall Windows fairly regularly, you mi...