How to Move your Windows User Profile to another Drive
Update: I’ve revised this article a bit based on some feedback from visitors, and to clarify certain steps a bit better.
Another Update: A lot of people seem to run into trouble trying to do this, and can’t seem to understand where they went wrong. Please do understand that everyone’s situation is a little bit different, and I can’t list every possible step that everyone, under every possible circumstance, would need to perform. At the very least, you need to be a little bit self-sufficient here – and if you don’t understand why you might need to reset permissions on your user profile folder after you move it (or how to do that), or if you don’t understand how to copy your user profile in its entirety (hidden and system files included), then perhaps you shouldn’t try to use this method. After all, we are talking about moving your user profile here – and if you don’t know what you’re doing, you can end up with a big mess. You have been warned!
Lately I’ve seen a lot of posts about various ways to move your Windows user profile (or various parts of it) to another drive or location.
Some of these posts suggest using the “Microsoft-approved” method of right-clicking certain folders in your user profile directory (“My Documents” if you’re using XP, and “Documents,” “Music,” “Videos,” and “Pictures” if you’re using Vista or Windows 7) and selecting “Properties” and using the options there to change the default location of those folders (some posts suggest editing the registry directly rather than using the UI).
Above: the “Microsoft-Approved” way to change special folder locations.
Other posts suggest using an unattended install of Windows, which can allow you to set the user profile directory that Windows will use to something other than the default.
I’ve found these methods to be less then optimal, for several reasons:
- The “Microsoft-approved” method will certainly move your folders, but some programs just blindly assume where your user profile is and will write to the original default directory, ignoring the fact that you’ve changed it.
- You can’t move your whole profile with this method – only certain folders within it. (For example, you can’t move your “Application Data” or “AppData” folders using this method.)
- The unattended install method of course means re-installing Windows (and is not for the technically faint-of-heart).
I have talked about my method for moving my user profile before, but I think it bears repeating.
My user profile was getting very large – as in, really, really large. I was running out of space on my C: drive, and I had a 2nd hard drive onto which I could move things, but I didn’t want to move things piecemeal – I wanted the whole kit & kaboodle. I didn’t just want my documents, videos, music, and pictures moved – I also wanted my ISO images, virtual machine hard drives, and email archives moved – a lot of which lived in my “AppData” folder. I wanted to give my user profile room to “grow” – and I also wanted the performance benefit of having my user profile on a different physical hard drive from my OS drive.
The picture below shows what I ended up doing – I created an NTFS junction point for my user profile, and moved it onto a 2nd hard drive. The result: my OS drive, C:, is just my OS (and programs). The 2nd hard drive (labeled K:) is entirely my user profile. Obviously, it’s grown a bit since I moved it!
So what do you do if you’re in a similar situation and want to move your entire user profile to a different drive (or just a different location on the same disk)?
Enter NTFS directory junction points.
If you’ve ever used UNIX or Linux, you may be familiar with the concept – however, if you’re not familiar with the concept, it’s fairly simple to imagine (I’ve talked about it before as well). Basically, think of a junction as a file-system-level shortcut. Whereas “normal” Windows shortcuts only work in Windows (and are actually little files that redirect you when you click on them), a junction operates at a much “lower” level in the file system, silently redirecting access requests. (This Wikipedia article does a better job explaining what they are than I could ever do, if you’re curious.)
And that’s the key fact here – because support for a junction is built right into the NTFS file system itself, it’s basically invisible to any higher programs. (Programs can detect a junction of course, if they specifically ask – but few programs do.) So you can redirect any folder into another folder on your computer (including on a different physical hard drive). Which, coincidentally, is just what we’re after!
Before we begin though, it’s worth mentioning that this process involves moving your user profile files around – which can be risky if the move gets interrupted or something terrible goes wrong (power outage while you’re doing it, etc.). So take the time to do a complete backup of your data before trying this – but you knew that already, didn’t you?
So, with that said, here are the steps to move your user profile to another location using directory junctions:
- Prepare your 2nd hard drive (or whatever destination you’ve chosen) and pick whatever folder you want to “junction” to.
- Log out of your user profile and log back in under a different account. If you don’t have a 2nd account, just create one temporarily. Remember to give it full administrator power over your computer or you won’t be able to proceed!
- Move EVERYTHING out of your old user profile directory to your new profile directory (e.g., move everything from C:\Users\UserName-Temp). Don’t just copy the files, you need to move them, because you can’t create a junction if a folder by the same name already exists. Your user profile folder is C:\Documents and Settings\UserName if you’re using XP, or C:\Users\UserName if you’re using Vista or Windows 7. Make sure you move hidden and system files, too!
Note: if you run into trouble moving the files (for example, Windows tells you that files are still “in use”) you may need to reboot into “Safe Mode” to make sure there are no programs/services that are locking files that you want to move. - Once you’ve moved all your files, rename your old user profile directory – it doesn’t matter to what, just as long as it’s different (e.g., rename it to C:\Users\UserName.old). After you’re done with the junction and you’re sure everything is working right, you can delete your old user profile directory – just make sure it is REALLY empty before you delete it!!! (Make sure to check for hidden and system files!)
- Open a command prompt (Start > Run > cmd will do the trick) and create the junction with the command: mklink /J C:\Users\UserName D:\Users\UserName
(If you are using Windows XP or earlier, you won’t have the mklink command on your computer – you can use the Sysinternals junction tool to do the same thing. The command line is a little bit different, so be sure to make that adjustment!)
Note: if you are using Windows Vista or Windows 7, you will probably have to right-click the command prompt and choose Run as Administrator. - Now you can log out of this “temporary” user and back in as your regular user account. (You can delete the temporary account, as we’re done using it.)
If you did everything right, you should be able to log in normally and nobody will be the wiser (except for you, of course!).
The beauty of this is that it works, and it works silently. Windows doesn’t notice a thing (well, it does, but it doesn’t say anything about it) – you’ll log on normally, and all your programs will just work. Folder redirection is beautiful like that.
Above: This is what a redirected user profile folder looks like in Windows Vista. Windows “knows” that it is a directory junction (hence the shortcut overlay icon), but it’s not really a “shortcut” in the traditional sense.
Above: after double-clicking on the user’s folder in the previous picture, you’ll see the user’s folders as you’d normally expect. Notice the address bar still shows this as being on the C: drive, even though it’s not. (Click the image for a larger version.)
Above: here’s the same folder, but instead of browsing to it via C:\Users, I went in through the K: drive (my 2nd hard drive). This is where the files really live. (Click the image for a larger version.)
Note that there ARE some caveats with this method:
- If you are using Windows XP, you will run into a bug with NTFS mount points.
- If you ever try to upgrade Windows, you may run into problems because of the redirection.
- If your destination folder is on a different volume then permissions will not be inherited and you will have to set the permissions on the destination folder manually (just copy them from your existing user profile folder).
- If your profile grows to be larger than the free space on your primary OS drive (usually C:), then you may have problems if you ever delete your user account and choose to “save the files” rather than delete them (something I ran into by accident myself).
Nevertheless, even with these warnings and caveats, using directory junctions is a highly effective method for moving your user profile out from the “default” location and into some other location of your own choosing. Hopefully, one day it will be possible in Windows to move your entire user profile to a different location without resorting to tricks like this, but for now, this is probably your best bet.
If you would like to know a little bit more about junction points, symbolic links, the mklink command, and so on, Wikipedia has several good articles to get you started:
- NTFS junction point (directory junction)
- NTFS symbolic link (only on Vista or later)
- NTFS hard links
- Sysinternals’ junction command (for Windows XP and earlier that lack the mklink command)

May 18, 2009 | Posted by Keithius 



Categories:
Tags: