- Saturday, March 24, 2007
Emulating Vista's User Directory Structure on XP
Perhaps the best new "feature" of Windows Vista is the Unix-inspired re-organization of user home directories. That is, instead of placing user-specific files under the abhorrent
Documents and Settingsdirectory, each user's folder resides under the command-line-friendlyUsersdirectory in the root system drive. Even better, your music is no longer considered a document. It's hard to argue against the fact thatC:\Users\Derek\Musicis cleaner thanC:\Documents and Settings\Derek\My Documents\My Music(or in some cases, the 8.3 friendlyC:\DOCUME~1\Derek\MYDOCU~1\MYMUSI~1, ack!).I use Vista on a couple of my computers, and I've grown to appreciate the new folder structure. Gone are the days of hacking together your own home directory structures just to try and cope with the unfriendly madness (who hasn't created a folder or two under
C:\just to make them typable?). Unfortunately, I still use several machines running XP, so it's hard to rely on this sane structure -- leading to grotesque hacks such as functions calledghetto-dosifyin my.emacsfile (I wish I were kidding).There are some additional advantages to utilizing the built-in home directory structure rather than creating your own. For example, the Run dialog resolves path reference relative to your home directory. So, if you type
Start -> Run -> ., your home directory will open. Sub-folders can be accessed just as easily -- typingStart -> Run -> dev\blogopens my blog source tree. Also, many tools (backup, indexing, etc.) will only consider content in your actual profile directory (the one that Windows knows about).Another nice benefit is that the compact path structure is Cygwin-friendly, so you can safely set your
HOMEenvironment variable (also used by Emacs, of course). Thus,~/Desktopin Cygwin matches~\Desktopin Powershell. I keep myHOMEdirectory synced across many machines (Vista, XP, and Linux) using Subversion, and it's nice being able to keep everything in the same place.Fortunately, we can make some relatively simple tweaks to our XP systems to make the structure more closely resemble that of our Vista and Unix friends.
Junction, Junction, What's your Function?
Chances are you've been running your operating system for a while, and you've got a bunch of clutter under your
Documents and Settingsfolder. More importantly, you probably have a bunch of applications with stored absolute paths under that folder, not to mention all of those common dialog pointers. So obviously, just renaming theDocuments and Settingsfolder is going to cause more problems than it'll solve.If XP had symlinks (another feature added in Vista), of course, we'd have an easy solution. We could simply type
ln -s DOCUME~1 Users, and we'd be off to a good start. We could update environment variables to use our new path structure, and we wouldn't break the old path references. Fortunately, XP does support directory symlinks ... well, sort of. XP's default file system, NTFS, supports something called a "junction point". For our needs, it'll do.While junctions are supported by NTFS, there is no built-in tool for creating them. Enter Junction, a simple command line tool for creating (and viewing targets of) NTFS junction points. With the tool located in your PATH, run the following command sequence to create the link:
C:\Documents and Settings\Derek>cd \ C:\>junction Users "Documents and Settings" Junction v1.04 - Windows junction creator and reparse point viewer Copyright (C) 2000-2005 Mark Russinovich Systems Internals - http://www.sysinternals.com Created: C:\Users Targetted at: C:\Documents and Settings
Special Folders
At this point, we can access our home directory under the
Userspath, but unfortunately Windows has no idea that we've actually intended to change our home directory. For example, starting a fresh command line session stills shows that old, annoyingDocuments and Settingspath.To fix this, we need to dig into the registry. Under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList, there should be a number of keys in the formS-x-x-xx-.... Browse through the keys until you find the one with aProfileImagePathvalue ending with your user name (e.g.%SystemDrive%\Documents and Settings\Derek). Change this value to use the new path (e.g.%SystemDrive%\Users\Derek). You will need to restart Windows for it to pick up the change.
After rebooting, you should default to the new
Userspath when starting a fresh console session. And because it's actually a junction point, all of your existing files should be right there with you. This is a nice start, but there are still some annoyances:My Documentsshould beDocuments,My Music(and its similarly named friends) should also drop the silly "My" prefix, and ascend one directory (unless you think music is a document, of course).Again, junction points are exactly what we need. Use the following command sequence to set them up:
C:\Users\Derek>junction Documents "My Documents" ... C:\Users\Derek>for %f in (Music Pictures Videos) do junction %f "My Documents\My %f" ...
You might also want to hide the
My Documentsfolder, so you don't see two references to the same folder when browsing your home directory. You could just make it hidden, but if you're like me you have hidden folder display enabled. In this case, we just need to make it hidden and give it the system attribute using the following command:attrib +S +H "My Documents".Our paths are now much prettier, but we do get stuck with the ugly default folder icon. Fortunately, you can right click on the folder whose icon you wish to update, click Properties, and change the icon in the Customize tab (you must do this before the next step, where they are assigned as special folders). I use the normal icons in
shell32.dllforDocumentsand the like. For my root home directory (Derek), I useuser-home.ico(attached to this post) from the Tango Desktop Project. The icon was conveniently translated to ICO format by Ben Brown. You might receive a warning about "enabling task folders", this is safe to ignore.As with the
Usersjunction point, we need to tell Windows about our new paths. For this, we'll use a Microsoft tool called Tweak UI. Install the tool, start it (Start -> Run -> tweakui), and select theSpecial Foldersitem underMy Computerin the tree control. Here you can select each path for which we created a junction, and assign the new path.
Common Dialogs
We've solved our ugly path problem, but overall usability still leaves something to be desired. For example, our common dialogs all have direct pointers to our
Documentsfolder, but it's still rather painful to get to our root home directory to, say, open a music file.Fortunately, Tweak UI comes in handy here as well. Under
Common Dialogs, selectPlaces Bar, and chooseCustom Places Bar. Here, you can define up to five paths that you will have easy access to using the common file dialog used by most Windows applications.
Here's the new dialog in action:

Another nice convenience is having a home directory link in your start menu, as below (simply drag the link there to create the shortcut):

Attachments
Comments
- Sunday, March 25, 2007 4:17:27 AM by CoreyThanks for this--helps out neat freaks like myself!
- Monday, April 02, 2007 2:55:40 PM by tom tI'm using Emacs on Vista. Vista won't let emacs write to c:/, where .emacs , .emacs-places, are kept. Suggestions? Give Full Control to C:/ to my user? Would rather make Emacs use some other place for these files but don't see how to do it.
- Tuesday, April 03, 2007 3:21:43 AM by tom tEmacs/Vista problem solved--I defined an environment variable HOME = /users/tom and emacs uses that location now for .emacs-places, .emacs, etc.
- Thursday, April 05, 2007 6:17:02 AM by oliverwhat i did on my was completely rerouted my home folder in another partition and edited the shell folders and user shell folders inthe hives of the registry via regedit. but this is a cool way to do. i'll practice onthe other machine :)
- Saturday, April 07, 2007 8:52:36 PM by Josh MYours was the first article to come up when I did a search on changing the location of a Vista user profile directory. So, I thought I'd add that I wrote up a quick HOWTO on how I did this.
http://joshmouch.wordpress.com/2007/04/07/change-user-profile-folder-location-in-vista/ - Thursday, April 19, 2007 6:12:33 AM by NathanVery cool, I didn't know that vista added symlinks. That must have been why it took so long ;) Only downfall with this method is that some apps don't use the RegKey, they just hardcode the path in their programs :(. Thanks though. BTW is the question below a robot detector?
- Tuesday, June 26, 2007 5:22:40 AM by AnthonyThanks a lot, I've been waiting for something like this for a while.
- Monday, August 06, 2007 5:14:13 AM by FortisThanks! Finally you helped me to make the directory structure I like. And the new 'home' icon looks cool however it does not show up on the 'start' menu...
- Monday, December 03, 2007 7:03:22 AM by DanielaHelpfull.. Thanks a lot!
- Thursday, December 27, 2007 9:44:48 PM by SteveThis is great, thank you! However, when I open windows explorer "My Documents" is still listed at top, which goes to the documents folder in my home directory. Is there a way to have it go just to the home directory?
- Sunday, January 20, 2008 3:21:49 AM by Ryan MeraySo from what I can tell, the junction function is useless in situations where you have two drives, say a 750GB primary drive and a 150GB boot drive, and you want the 750GB drive to become the holder of your Users folder instead of the smaller drive.
I was hoping that Junction would allow previous applications to continue to run off the data located in the old destination, while the new stuff created after the registry edits would actually physically be stored at the junctioned location. Instead, it looks like that Junction location is merely a permalink to the old location, which leaves the data on the smaller boot drive.
Looks like I'm gonna have to dig through my book of registry edits to get that permanant move. Bummer.
This is pretty slick though for single-drive installations. - Saturday, January 26, 2008 7:08:30 PM by MortenCool! I completely agree with you on that being the best "feature" of Windows Vista.
Thanks for giving me the best of Vista on XP :D
One other thing, how did you make Windows XP look like that? I really like the dark-blueish look. - Wednesday, June 25, 2008 2:27:55 AM by ChrisHello, Ryan Meray, there is indeed a way to do it using separate hard drives. If you move the "My Documents" folder from your c: drive to your external drive, and then create the junction back to the C: drive, then it will work as you wish!
- Sunday, August 31, 2008 4:00:36 PM by KorvThank you very much! This works great! I had to fix some stuff like my pictures etc. disappearing from start menu, but now its working perfectly. I've been looking for something like this for a long time!
- Tuesday, September 30, 2008 2:55:30 AM by LouGreat writeup thanks for sharing. btw what theme is that you are using? I like the color scheme.
- Thursday, October 23, 2008 3:39:15 AM by BradAwesome work. This was pretty much the only feature I liked about Vista. I have a couple questions though:
1. When I click on my new "Documents" folder, I still see "My Music...etc". How do I get rid of (hide) these without deleting everything.
2. When I display hidden folders and I navigate to "C:/Users/Brad" everything is displayed including "Application Data" and all that stuff. Is there anyway to keep all that from displaying there and have it only display in the existing "documents and settings" folder? - Saturday, November 29, 2008 2:46:08 PM by MikeWhat theme are you using in the screen shots above for XP?
thanks, Mike - Saturday, February 07, 2009 2:22:05 PM by Wolfgang SchneiderHi,
this sounds like what I am looking for ... but I am unclear whether I have to first create the new folders to which I will then "junction" the old folders? Do I need to create the folders on drive D:, then copy contents and folders from c:\documents and Settings\wolfgang\... and afterwards I can then create the "junction" to D:\users etc ?
Any clarification would be appreciated.
Cheers,
Wolfgang
eMail: wschn123@t-online.de - Saturday, July 04, 2009 5:12:01 AM by Chris PThis is a great post - I've set up a real Home directory now. One thing I also did was made a "My Home" Virtual Folder using information from:
http://msdn.microsoft.com/en-us/library/ms997573.aspx
My registry file to amke this work is here:
===
Windows Registry Editor Version 5.00
; These reg entries create a "Virtual Folder", ie. a new folder visible in the shell
; that looks and behaves like a users "home" directory.
; See: "Creating Shell Extensions with Shell Instance Objects":
; http://msdn.microsoft.com/en-us/library/ms997573.aspx
; NOTE this my UUID (AE5CCCC6-31F7-48C2-9028-7ABF7EF8FE9D) - I guess you should make your own?
[HKEY_CLASSES_ROOT\CLSID\{AE5CCCC6-31F7-48C2-9028-7ABF7EF8FE9D}]
@="Home"
"InfoTip"="Home Directory"
; This is: "%SystemRoot%\system32\ieframe.dll,0"
; NOTE the ",n" is the difference between the IconID you want and the IconID of the first Icon in the file
[HKEY_CLASSES_ROOT\CLSID\{AE5CCCC6-31F7-48C2-9028-7ABF7EF8FE9D}\DefaultIcon]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,69,00,65,00,\
66,00,72,00,61,00,6d,00,65,00,2e,00,64,00,6c,00,6c,00,2c,00,30,00,00,00
; This is: %SystemRoot%\system32\shdocvw.dll - the DLL that makes "Shell Instance Objects" work
[HKEY_CLASSES_ROOT\CLSID\{AE5CCCC6-31F7-48C2-9028-7ABF7EF8FE9D}\InProcServer32]
"ThreadingModel"="Apartment"
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,\
64,00,6f,00,63,00,76,00,77,00,2e,00,64,00,6c,00,6c,00,00,00
; This is a "special" uuid that means "CLSID_FolderShortcut"
[HKEY_CLASSES_ROOT\CLSID\{AE5CCCC6-31F7-48C2-9028-7ABF7EF8FE9D}\Instance]
@=""
"CLSID"="{0AFACED1-E828-11D1-9187-B532F1E9575D}"
; This means: CSIDL_PROFILE - or the user home directory special folder
[HKEY_CLASSES_ROOT\CLSID\{AE5CCCC6-31F7-48C2-9028-7ABF7EF8FE9D}\Instance\InitPropertyBag]
"TargetSpecialFolder"="0x0028"
; The ShellFolder attributes are:
; SFGAO_CANRENAME (0x00000010)
; SFGAO_DROPTARGET (0x00000100)
; SFGAO_FOLDER (0x20000000)
; SFGAO_FILESYSTEM (0x40000000)
; SFGAO_HASSUBFOLDER (0x80000000)
[HKEY_CLASSES_ROOT\CLSID\{AE5CCCC6-31F7-48C2-9028-7ABF7EF8FE9D}\ShellFolder]
"Attributes"=dword:e0000110
"WantsFORPARSING"=""
; The uuid that is the CLSID also needs to be added to the shell folder namespace, in this case under the "Desktop" folder.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{AE5CCCC6-31F7-48C2-9028-7ABF7EF8FE9D}]
@="Home Directory"
=== - Thursday, December 24, 2009 6:05:11 AM by nikolainikitinHello, Dear Colleagues.
Sorry that is not quite in the topic copyright derekslager.com appeal,
want to open a long blog or forum about <a href=http://www.pnevmatika.su/>pneumatic weapons</a>, but never with the board software and the blog can not define.
Need engine because of the blog and forum with the normal protection against spam, and then my friend found a forum filled with spam, and its already after 2 weeks.
And you are a software engine for derekslager.com use? Which script forums and blogs I choose to open a forum about air guns?
I'll be glad to any advice, thanks in advance. - Tuesday, January 26, 2010 8:53:06 PM by Lisa18IGSometimes students have assignments to compose the essay buying paper about this good topic. But a lot of them are not experienced essays writers. So, what to do in this case? We instantly suggest to buy essay papers in the online writing service.
- Thursday, March 04, 2010 12:38:52 AM by mortgage loansDo not a lot of money to buy a building? You should not worry, just because it is real to receive the home loans to solve such problems. Therefore take a sba loan to buy everything you require.
- Saturday, March 06, 2010 2:33:30 PM by Best Blu Ray Ripperthere are a lot of freeware alternatives for this.. no need to emulate.
- Saturday, March 06, 2010 2:34:29 PM by best blu ray makerthats interesting taht you went through all that emulation when there are ready apps for that?
- Saturday, March 27, 2010 2:17:17 PM by Weight Loss ResourcexGreat post. you can buy any posts or
- Thursday, April 08, 2010 9:14:57 AM by Penis Enlargement / Enhancement Pills ReviewsThanks a lot for sharing.
- Thursday, April 08, 2010 9:29:53 AM by Top Penis Enlargement / Enhancement PillsThis is really a well laid out website. I like how you have presented the information in full detail.
- Thursday, April 08, 2010 9:45:47 AM by Penis Enlargement / Enhancement Patches ReviewsWell worth the read. Thanks for sharing this information. Thanks
- Thursday, April 08, 2010 9:53:29 AM by Top Penis Enlargement / Enhancement PatchesInteresting post. I normally comment AFTER reading the posts I visit.
- Thursday, April 08, 2010 10:39:38 AM by Penis Enlargement Devices ReviewsThis is really a well laid out website. I like how you have presented the information in full detail.
- Thursday, April 08, 2010 10:52:03 AM by Top Penis Enlargement DevicesI believe the information covered in the discussion is top notch. I’ve been doing a research on the subject and your blog just cleared up a lot of questions. I am working on a essay writing and term paper for my English class and currently
- Thursday, April 08, 2010 10:59:44 AM by Penis Enlargement Exercise Programs ReviewsGreat post. you can buy any posts
- Thursday, April 08, 2010 11:10:38 AM by Top Penis Enlargement Exercise ProgramsWell worth the read. Thanks for sharing
- Friday, April 09, 2010 10:33:24 AM by essay writingThanks to the author for sharing this wonderful material. I am not very knoledgeable in this respect that is why I will send the link to my brother, I hope, it will be useful for him and return to my essay writing after a short pause.
- Monday, April 26, 2010 5:30:21 AM by uplongtimeyou article really help me, thanks
- Monday, May 10, 2010 12:42:55 PM by Penis Enhancement PillsUseful piece of writing, this is very similar to a site that I have.
- Monday, May 10, 2010 12:47:19 PM by Penis Enhancement Pillsnice article and wonderful and structured blog.
- Monday, May 10, 2010 12:50:51 PM by Penis Enhancement PatchesPlease check it out sometime and feel free to leave me a comenet on it and tell me what you think. I'm always looking for feedback.
- Monday, May 10, 2010 12:55:49 PM by Penis Enhancement PatchesThank you very much! This works great! I had to fix some stuff like my pictures etc. disappearing from start menu, but now its working perfectly. I've been looking for something like this for a long time!
- Monday, May 10, 2010 1:06:31 PM by Penis Enlargement DevicesNice Blog! It is very excellent!
- Monday, May 10, 2010 1:14:22 PM by Penis Enlargement ExerciseThank you I always wanted to write in my site something like that. Can I take part of your post to my blog.
- Monday, May 10, 2010 1:18:41 PM by Penis Enlargement ExerciseHello webmaster I like your post. I found your site on del.icio.us today and really liked it. I bookmarked it and will be back to check it out some more later.
- Wednesday, May 19, 2010 9:36:24 AM by Sex Toys ReviewsI wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post
- Wednesday, May 19, 2010 9:39:55 AM by Breast Enlargement ReviewsNice site. I think it's gonna do very very well.
- Wednesday, May 19, 2010 9:42:52 AM by Pheromone ReviewsI know this is off topic.. What is the blogging software that you are using? I know it's not Wordpress, but it looks really nice.
- Wednesday, May 19, 2010 9:45:37 AM by Female Libidowanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post
- Wednesday, May 19, 2010 9:48:51 AM by Semen EnhancersNice site. I think it's gonna do very very well. for sure
- Sunday, June 06, 2010 10:07:27 AM by Online Forex ReviewsHello, this blog is just what I’ve been searching for. I need to accomplish some investigation, and your post has probably saved me countless hours at the library.
- Sunday, June 06, 2010 10:09:39 AM by Human Growth Hormone ReviewsHello, I’m really glad I discovered your site. I like your style of writing, not just the topic. I will certainly be visiting regularly to see if you’ve got more updates.
- Sunday, June 06, 2010 10:11:55 AM by Web Hosting ReviewsTook me time to go through all of the feedback, however I actually loved the article. It proved to be very useful to me and I am certain to all the commenters right here as well! It's all the time nice when you cannot solely be told, but additionally entertained! I am certain you had enjoyed penning this blog post.
- Sunday, June 06, 2010 10:13:47 AM by Online Casino ReviewsLooks like the author has massive awareness in the subject. Thanks you for the info.
- Sunday, June 06, 2010 10:15:30 AM by Hair Growth ReviewsI adore this post! It is a great example of how you can write a good blog post. I have a friend who wants to begin a blog and I’m going to point her your way so that she can pick up a few pointers.
- Sunday, June 06, 2010 10:17:14 AM by Online Auto Responder ReviewsLooks like the author has massive awareness in the subject. Thanks you for the info.
- Sunday, June 06, 2010 10:18:52 AM by Online Pharmacy ReviewsThank you very much. I am wonderring if i can share your article in the bookmarks of society,Then more friends can talk about this problem.
- Sunday, June 06, 2010 10:20:50 AM by Skin Care / Anti-Aging ReviewsI just cant stop reading this. Its so cool, so full of information that I just didn't know. I'm glad to see that people are actually writing about this issue in such a smart way, showing us all different sides to it. You're a great blogger. Please keep it up. I cant wait to read whats next.
- Sunday, June 06, 2010 10:22:29 AM by Quit Smoking ReviewsTook me time to go through all of the feedback, however I actually loved the article. It proved to be very useful to me and I am certain to all the commenters right here as well! It's all the time nice when you cannot solely be told, but additionally entertained! I am certain you had enjoyed penning this blog post.
- Sunday, June 06, 2010 10:24:25 AM by Hair Remover ReviewsHi! I get pleasure from analyzing your posts every morning. It’s obvious that your thoughts reflect a good deal of other people’s opinions also.
- Sunday, June 06, 2010 10:26:09 AM by Anti-Aging / Skin Care ReviewsHello, how do you add a blog for your RSS feed? I’m really bad at technology and I just don’t understand it. Would really appreciate if anyone could assist me.
- Tuesday, June 08, 2010 3:33:44 AM by Volker Lange from GermanyHallo, ich kam durch Zufall auf diese Seite und möchte einen netten Gruß hinterlassen. Ich würde mich freuen, wenn ihr auf meiner Homepage auch einmal vorbei schauen würdet! Vielleicht wollt ihr einmal auf Sylt Westerland http://www.MeerblickSylt.de oder an der Ostsee http://www.OstseeblickHolm.de Urlaub machen?! Wir haben dort sehr schöne Meerblickwohnungen. Vielleicht bis bald einmal!
Herzliche Grüße - Tuesday, June 08, 2010 11:20:33 PM by campionatul mondial de fotbal 2010its a great post!thanks for sharing
- Thursday, June 17, 2010 12:53:38 PM by programul campionatului de fotbal 2010its a great post!
- Tuesday, June 22, 2010 1:40:41 PM by R.SakowskiViele Gruesse aus dem schoenen Fischerdorf Greetsiel.
- Friday, June 25, 2010 5:37:16 PM by biletul zileinice article!
- Sunday, July 04, 2010 10:41:13 PM by bwinits a great post!thanks for sharing
- Monday, July 05, 2010 1:58:19 PM by bonus bet365great article!thanks
- Saturday, July 10, 2010 11:49:44 AM by Term PapersThis is an astonishing entry. Thank you very much for the supreme post provided! I was looking for this entry for a long time, but I wasn’t able to find a trusted source.