Saurabh Chowdhury on programming and life.
in

Another Type of Virtual Folders?

For all practical purposes Virtual Folders are, what are now known in Windows Vista as Search Folders. After all if you search for "Virtual Folders" in Help & Support the top result is "Saved search (definition)". Virtual folders have had a rough ride during the Vista development cycle. With the demise of WinFS it was obvious that they would take the biggest casualty. However virtual folders still existed with much dignity in Windows Vista Beta1 (build 5112) and a few more successive builds. Fast forward to RC1 build 5728... Search Folders have by now changed their extension from .vfolder to .search-ms, keeping the relatively simple architecture, you can read a nice introduction to virtual folders on Paul Thurrott's Supersite for Windows here .

Let me now introduce you to what I call Ghost Folders; for the lack of a proper term. They are different from Virtual folders because of the fact that unlike a search folder which exists in the filesystem in some form (as it is nothing but an XML file) these Ghost Folders don't seem to have any existence in the filesystem. I store my music, pictures, videos and files & documents in 4 different partitions (volumes in true Windows speak) of a different hard disc. So, after installing Windows Vista I change the location attribute of Music & Pictures in the Start Menu to point to these folders. Here's how I did it for the Music folder (Note: Windows does not suffix "folder" in the description text after either Documents, Pictures or Music unlike your account name's folder, hover your mouse over each of these 4 icons to see what I mean).

  1. Right Click on Music
  2. Click on Location Tab
  3. Click on the Move Button
  4. Locate the new location in the file dialog
  5. Click on the Apply Button
  6. Click on Yes of the Move Folder Confirmation Prompt (All it does is copy the desktop.ini & Sample Music shortcut that was in the original Music folder)

Similarly I changed the location of Pictures. Two pretty interesting things happen here, which are also the 2 cases where you can see Ghost Folders.

1. Say in the above example I chose the location "H:\MUSiK"... now whenever I traverse to I: in Windows Explorer; I no longer see MUSiK folder, what I see is Music. But if I run DIR on H:\ drive I see MUSiK and not Music. See Picture…
Music is Actually MUSiK
Perhaps it's easy to unravel this behavior, apparently it's because of the new attributes of the Desktop.ini namely, LocalizedResourceName under [.ShellClassInfo] and/or the new section [LocalizedFileNames]. But someone curious enough can find out on their own why MUSiK appears to be Music in Explorer. However remember I said the Sample Music shortcut is also moved in MUSiK. I can't explain why it still says H:\Music in the folder path in the details tab. Look at the screenshot below. That's case 1 for Ghost Folders. Why does the folder path refer to a location that does not exist in the file system?
Windows Vista Sample Music Shortcut

2. The second and even weirder thing happens when you open the user account folder by clicking on your account name in the Start Menu. You still see Music & Pictures in the explorer window.
The Current User's Folder!
On the surface ,nothing strange seems about it, but here's the weird part when I traverse to C:\Users\Dark Knight in Windows Explorer I do not see Music and Pictures file folders. Notice the item count in the picture above it's 29. Note: I have set folder options to show both "hidden" and "protected operating system files".
C:\Users\Dark Knight
Notice the item count here - 27. Where did Music & Pictures go?
And running a "DIR /a" command did no good here. Almost immediately the one thing that came into my mind was "Reparse Points". Since my knowledge of junctions/symlinks on Windows was minimal, hence without further investigation I shot off an email to Scott Hanselman who; gratefully, replied rather sooner than I expected. Thank you Scott!
DIR command Output
There are a lot of Junctions here basically for application compatibility purposes for old/current apps. There are 7 files too. But all of them would be recognizable to any Power User with the exception of the files with the .regtrans-ms extensions which seem to be transaction files of the registry (NTUSER.DAT being the User's registry file). But suppose I have the wrong idea about them. The GUID part in the filename reminded me of the old trick where one could obfuscate a normal folder into Control Panel or any other shell folder of the desktop namespace. I know this does not work on files rather only on folders, but assuming there's a new "feature" in Vista. The one thing bothering me was that even if there is a pointer of some kind inside my account folder it must physically exist in C:\Users\Dark Knight
e.g. When you create a folder called "Control Panel.{21EC2O2O-3AEA-1O69-A2DD-08002b30309d}" although it might appear as "Control Panel" in explorer where double-clicking on it will infact open the Control Panel, you can still see the full name of this folder & list it's contents i.e. Control Panel{GUID} in DOS prompt.

So maybe it's NTUSER.DAT{GUID}.TMContainer<NumericIndex>.regtrans.ms files that are now acting as pointers to the actual Music & Pictures. But, not only this does not make much sense, nothing seems to suggest that as both files from the Command Prompt screenshot bear the same GUID (remember there were 2 folders unaccounted for!). Considering the GUID might be for the user account and the contents of this file point to the Ghost Folders that also ain't true as there is no corresponding entry in the registry for {4bcf23ed-4700-11db-b1fa-a8319ff2f784} in my registry. Besides if it were somehow possible you wouldn't see Pictures & Music and 2 such files together in the user account folder! (Look at the screenshot with 29 items again) This damn thing has been itching my brain for the past 2-3 days now. I can't seem to explain why there's a difference between the 2 explorer views.

I know, I know! Not a matter of life and death here. But it would be really great if someone can explain how do the Pictures & Music folders appear when I open the <User Account> folder although they simply don't exist in the physical location (C:\Users\<AccountName>) and why do they show up as File Folder in the User Account window? Or if they do exist as some hip kind of reparse pointers in the filesystem what is it exactly?

» Trackbacks & Pingbacks

    No trackbacks yet.
Trackback url for this post:
http://darkknight.thinkers-inc.com/blogs/chad/trackback.ashx?PostID=130

» Comments

  1. As you have said, Virtual Folders exist no longer in Vista. I've also noticed that desktop.ini tend to produce behaviors, but I erased most of them. I like your idea of "ghost folders". The point is to get a folder behave like one of those special  Music and Pictures folders, I guess... Oh, and I am not sure searching for an explanation about those invisible pointers is worth the effort.

    Olivier — April 7, 2007 9:26 PM

» Leave a Comment

(required) 
(optional)
(required) 

Submit