Thursday, September 2 2010
Subscribe: Posts | Comments

Reparsing Folders in XP

Since I do a lot of development on my PC, I spend a lot of time working with the “My Documents\Visual Studio 2005\Projects” folder.  However, I’ve been finding it inconvenient that I need to constantly browse down to it from within Windows Explorer so I set about trying to find a way to add a shortcut that appears in the main folder list on the left, as per the image below:

Windows Explorer Folders PaneMy first thought was to simply create a standard Windows shortcut on the desktop, since this is clearly what I needed.  However, shortcuts aren’t shown in this pane – I needed a folder.

Now, I could have just created a folder on the desktop and told Visual Studio to point to it, but I wanted to leave the original directory structure intact (and I don’t like to be defeated by a computer! ;-) ).  Clearly, I needed something along the lines of the “My Documents” functionality that allows you to point one directory to another.

I finally found what I needed in the form of NTFS Reparse Points.  It turns out that there are tools out there that will do this for you, but they are not without their challenges (such as the risk of deleting all your files!)  Unfortunately, information on how to create these manually is quite sparse, so I had to do some digging!

It turns out that there’s a registry key that allows you to specify a new target for a directory, if used correctly:

Registry Key

If this key is referenced in a Desktop.ini file within a system folder, we can set it up to redirect to a shortcut names 'Target' in the same folder!

How to do this

  1. Create a new directory on the Desktop.
  2. Create a Desktop.ini file in the new folder containing the following:

    [.ShellClassInfo]
    CLSID2={0AFACED1-E828-11D1-9187-B532F1E9575D}
  3. Create a shortcut, also in the new directory, pointing to the actual directory of interest (in my case, the Visual Studio Projects folder).
  4. Rename this directory to Target.
  5. Now open a command prompt and navigate to the Desktop directory (ie. the parent of your new directory).
  6. Execute the following DOS command to specify that your new directory is a system folder:attrib +s <New Directory Name> /s /d

    where <New Directory Name> is the name of the directory that you’ve just created.

Congratulations – you’ve just created your shortcut directory! :)

If you ever need to remove it, you first need to remove the reparse point.  To do this, go back out to a command prompt in the parent directory and type:

attrib -s <New Directory Name> /s /d

Now you’ll be able to delete the Desktop.ini file and the shortcut, as well as the actual directory.

Enjoy! :)

No related posts.

Leave a Reply

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Submit Your Article
Make 10k in a Weekend
Aweber
Commission Blueprint

VIP Mailing List

Social Follow

Follow Me!
Domain Registrations starting at $9.69

Categories