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.
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)
Related posts:
Related posts brought to you by Yet Another Related Posts Plugin.

May 18, 2009 | Posted by Keithius 



Categories:
Tags:
This did not work for me. I cannot move the Appdata folder even though when prompted to give permission. How do you move the c:\Users\\Appdata folder?
Make sure you are logged in as a different user before trying to move anything under your normal user profile’s account – otherwise, files will be in use and you can’t move them. (See Step #2.)
And I assume you mean C:\Users\[YourUserName]\Appdata?
I’m logged in as a temp user I created, but it still thinks there are files in use in the other user’s folder. Argh! (I even rebooted to make sure).
Also, be careful (mildly so) as it’ll mangle permissions somewhat – I was being told I needed permission from the other user to move files! (we’re both Administrators…uh…what?)
Files may be in use in your profile especially if you have “services” running that use files in the user profile you used when they were installed. Since Windows Services run all the time (regardless of who is logged in) you may need to shut them down.
One way to help with this is to reboot into “Safe Mode” under the 2nd account and then move your files. Being in “Safe Mode” helps ensure that no pesky programs/services have locked files in the user profile you’re trying to move.
Also, depending on WHERE you move your user profile to, you may need to change the permissions – Windows permissions are not inherited across directory junctions, I believe. There’s no hard and fast rule for this, so just keep your wits about you and you should be OK.
I’ve tried this, but the problem I get, when I log back in it creates a temp user folder because it can’t find mine. This, I think, is due to the mklink comand having to create the User name folder to work. I had to delete my original user name folder for mklink to work. Can’t seem to get a grip on how to get around this.
I can’t remember whether the mklink /j command needs the “source” directory to be there, or if it doesn’t… that might be the source of the problem.
The way to test it is to see if you can browse to C:\Users\UserName and have it show you exactly what you’d expect to see (your user profile). If you can do this using Explorer, then Windows itself should find your profile no sweat.
Another thing to consider is this:
When you copy your user profile to the new location, make sure you have turned off the option in Windows to “hide system files” – otherwise you won’t copy the actual “user profile” files (e.g., ntuser.dat) and that will cause Windows to not use your new profile location.
Anyway, I hope that helps!
I think you may not need the J switch… If you are on Vista+ the ‘mklink’ command defaults to creating a smylink for FILES, I believe. So to create a symbolic link for a whole directory try; “mklink /D D:\DestinationDirectory C:\User\Username”
From the Windows mkdir command help:
Creates a symbolic link.
mklink [[/D] | [/H] | [/J]] link target
D – Creates a directory symbolic link. Default is a file symbolic link.
/H – Creates a hard link instead of a symbolic link.
/J – Creates a Directory Junction.
Link – specifies the new symbolic link name.
Target – specifies the path (relative or absolute) that the new link refers to.
Yes, the mklink command does default to creating symbolic links. I just prefer directory junctions myself, as they are supported on earlier versions of Windows – whereas symbolic links are only supported in Vista (and later).
Wouldn’t you also have an issue if the junction drive (in this case C:) were to fail? The junction info is stored on C:, so it seems to me that if that drive failed, bye bye to your junctions.
Well, yes, and no. If the junction drive (C:) were to fail, yes, you’d lose the junction – but your profile itself (the files and folders) is still accessible on the 2nd drive. If you plugged the 2nd drive into another computer, you’d be able to browse it just fine – all your files would be there. (They just wouldn’t be linked to your user profile anymore, which is completely understandable!)
Of course, if your C: drive fails you’ve got bigger issues to deal with than just your junction information being lost.
Hi, Keithius.
Very interesting thread.
But, what if I need to move the whole C:\Users to D:\Users, with the posibility for all new future user profiles to be created in the new location?
This method ensures me that? Is not better to change the Environment Varibles in the Registry without make links in the NTFS structure? (with the posterior search & replace of values to the new location).
I think your method only works for actual users but not for future users. I´m wrong ?
thanx for any reply.
Directory junctions are implemented at the filesystem level, so they are transparent to any applications running above them – including Windows itself (although Explorer is smart enough to check for them when it matters, such as when calculating free disk space and when recursively deleting a folder).
Because of this, they will work for moving the entire “Users” folder… but doing that is a bit trickier, since you need to be logged on in order to make a junction, and if you’re logged on, you can’t move your user profile folder (unless, of course, it’s already located somewhere else). So moving the ENTIRE C:\Users folder is quite a bit harder, simply because you’ve normally got some in-use “locked files” in there, so you can’t really “move” it per se. It’s sort of a chicken and egg problem.
But technically speaking, yes, junctions could indeed be used to move the entire Users folder somewhere else, and if you did, all future user profiles would be created in that new location.
The solution here is the Installer DVD command prompt. I´ll do some tests with this method. Seems to be a good option.
Yeaha, that was what i have looked for
It would have been a nice feature to have had the ability during user creation to specify where the users profile (documents, pics, video, etc.) during account creation.
Yes, that WOULD have been a nice feature to have. (Hint, hint, Microsoft!)
Has anyone tried this with Windows 7? I had to problem moving the original user account files and creating the junction point. However, when I tried to move/copy the files back into C:\Users\Sheldon (while signed on under a different account), there was a handful of files that I couldn’t move or copy back. I tried booting up in safe mode, stopped all the services I could, etc, but could not get those puppies to transfer. I got the “need admin access” message, but I had that.
Anyways, I decided to try booting up to my account without those files. It started up ok, but all my user account settings were gone, so I just restored from backup. I would love it if I could get this to work, as it’s exactly what I was looking for. Anyone know how to get those last few files to move back?
Make sure you are copying hidden and system files as well, otherwise your account won’t really be moved over.
Here are the folders that I could not copy back to my user account after setting up the junction point:
C:\Users\Sheldon\AppData\Local\Microsoft\CardSpace\ (all files)
C:\Users\Sheldon\AppData\Local\Temp\ (6 .tmp files)
Have you tried taking ownership of those files? Sometimes programs will write files to your user profile, but the program in question was running under a different user account – for example, the system account (common for services)… thus the files it created inherited the rights of the account under which they were created. That might be why you can’t move them, even though you are the administrator.
Hi,
I’ve been using Win7 RC7100, and I’ve used the mklink command. It’s touchy, it seems, and after re-installing the OS, it isn’t as simple; I’d have to rename my user directory (From Pete to Pete_Old, for instance), let Win7 create the new one, manually create a new one on a different volume, run mklink /d, and then copy everything over from the old to the new.
However, above and beyond that, my main question is in regards to permissions. It seems as if all the user directories on D: are “open” to whomever logs in. Even though the C:/User/Name may be locked to the individual, the D:/User/Name, to which the symbolic link points, is not. I haven’t tried playing with permissions (I haven’t been that brave yet), but any pointers as to how to rectify that situation would be helpful.
I used the mklink /D command to create a symbolic link, and not the junction, by the way.
Thanks
I believe permissions do not propagate across symbolic links or directory junctions, so you will have to set the permissions on the destination folder manually, yourself.
I thought this was my saviour, but an interesting quirk has caused me to write…
Creating the link has stopped internet explorer downloading anything. It’s very strange. Creating a profile that is not mklinked allows internet explorer to download any file normally. Create a profile that is mklinked (J) then reboot the machine, suddenly IE8 cannot download. Any thoughts?
Perhaps the profile is not moved over entirely? Or IE is trying to save downloaded files in a location that isn’t there anymore?
I hit the same issue above (unable to download files through IE). Turns out this is because after the move, the files under \\AppData are owned by Administrator (assuming your logged in as the Administrator to move the files). As a result, IE is unable to write to Temporary Internet Files, which is where it stores files as it downloads them. You need to reset the ownership of \ recursively so that all the files under that location are owned by you.
To do this, right click on \, click Properties -> Security -> Advanced -> Owner and make your username the owner of that folder and all child folders (make sure you check the box marked “Replace owner on subcontainers and objects”.).
Following this, open IE, go to Tools -> Internet Options, and delete everything under Temporary Internet Files, History, Cookies etc. . Close and restart IE and try downloading a file. This should now work.
That’s a good point – depending on how you copy the files (and where) the permissions might get changed. Always a good idea to check on them and reset them back to what they are supposed to be before you log in!
I bet a lot of the problems some people are experiencing with doing it this way is because there are a couple of problems that crop up when you copy or move the user folder to the new location:
First the owner/security settings are lost during the copy/move, but that is easily fixed by manually setting them back to the original settings.
Second, and most important, it will not copy or move the hidden directory junctions, which will cause big problems with some applications and backward compatibility with older programs.
That last problem is a little harder to fix because there are several hidden directory junctions throughout your user directory that you will need to manually re-create using the command prompt. It’s not impossible to to, but it takes a bit of time.
Before you copy or move your profile directory, open a command prompt, change to your user directory and type “dir /al /s > Junctions.txt”. This will create a text file with a list of the junctions that you will need to re-create.
Those are some very good tips – thanks for pointing that out!
It is not a good idea to run sdelete -c C: from a user which has been moved using this technique.
Why is that? That command just zeros out free disk space. Does sdelete get confused by the junction point or something?
I get this message when I try to enter the string in the command prompt
Cannot create a file when that file already exists
Does anyone else? Am I missing something big?
A little bit more detail would be helpful. What exactly are you typing into the command prompt? Why are you typing it? What is it you’re trying to do?
The fact that you’re getting an error means that you are missing something. Look up the instructions for the command you are using and make sure you’ve got all the parameters right.
Don’t just blindly copy & paste some command without knowing what it’s meant to be doing, and then ask for help when it doesn’t work – have you tried to figure it out at all on your own?
Remember, Google is your friend. Use it.
yes, Google is terrific. But to actually address parsec’s question, the reason for the “Cannot create a file…” error is because the instructions are incorrect.
Creating a link actually creates a file. Since your empty profile folder still exists in step #3, the link cannot be created. What is missing is the step where you delete the original profile folder.
However, an easier method would be to simply move your profile folder where you want it, then create a link to it. I haven’t tested this approach because I blindly followed the guidance above, but I see no reason it wouldn’t work, and save you a step:
[as the article states, none of these steps can be performed on your currently logged-in profile. Reboot + safemode with admin account is what I used]
1.) Move the profile folder to your new destination:
C:\Users\> robocopy C:\Users\UserName D:\Users\UserName /E /Z /COPYALL /MOVE
2.) Create the link
mklink /J C:\Users\UserName D:\DestinationDirectory\UserName
(and yes, you can make a link to a folder that is not empty.)
Part of the problem with the confusion here is that there are SO many different ways you can do this.
- You can create a directory junction
- You can create a hard-link
- You can create a symbolic link
- Or you can “mount” an entire partition to a particular folder using the Windows Disk Manager
Each one of these can be used to achieve the same end result, but there are “gotchas!” inherent in each method.
It’s also been a while since I’ve actually had to do this, so my memory is a bit rusty as to which “gotcha” goes with which method (I think the “empty folder” requirement applies to mounting a partition to a particular folder using the Windows Disk Manager method).
When in doubt, consult the documentation… or Wikipedia (which actually does a good job of explaining all the different variations on NTFS reparse points, and of course contains lots of really good references to articles with more detailed information).
I’m typing
mklink /J C:\Users\UserName D:\DestinationDirectory
on a Vista-64 computer.
I asked this question because no one else seems to be getting this precise error, and the error itself doesn’t really seem to make sense to me.
Try mike’s suggestion:
“Creating a link actually creates a file. Since your empty profile folder still exists in step #3, the link cannot be created. What is missing is the step where you delete the original profile folder.”
Or, to put it more succinctly:
Delete the (presumably now empty) “UserName” folder from C:\Users, then run mklink /J C:\Users\UserName D:\DestinationDirectory.
I find it helpful to run tests when in doubt – try creating a test folder on one drive, then another, and try junctioning them together, until you achieve the desired results. Then, substitute the “test” folders names for the real ones you want to junction.
Here’s an example session I did just now to double-check my results:
C:\>mkdir test
C:\>k:
K:\>mkdir test2
K:\>c:
C:\>mklink /J C:\test k:\test2
Cannot create a file when that file already exists.
C:\>mklink /D C:\test k:\test2
Cannot create a file when that file already exists.
C:\>mklink c:\test k:\test2
Access is denied.
C:\>rmdir test
C:\>mklink /J C:\test k:\test2
Junction created for C:\test < <===>> k:\test2
C:\>
I know I should update my article, but I just haven’t gotten around to it yet. Sorry.
Here’s another way to do this that I’ve used since WIndows NT with zero problems. It does not use links…. strictly registry changes.
1. Login as another administrator.
2. Copy your existing profile to the new drive/location (ex. C:\Users\Mark -> D:\Users\Mark)
3. Open regedit.exe and browse to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList.
4. Find the folder that looks something like S-1-5-21-814754908-2423985534-814754908-1001 with the registry key ProfileImagePath that matches your existing account (ex. C:\Users\Mark).
5. Change ProfileImagePath to point to your new profile location (ex. D:\Users\Mark).
6. Logout and login to the account that you changed.
7. Open the properties dialog on your My Documents folder (or other profile folder) and check the actual path. It should now be pointing to the new location.
8. Almost there… stay logged in and open regedt in your account. Do a global search on C:\Users\Mark and change all instances to D:\Users\Mark.
9. Reboot and re-login.
10. Recheck profile path and registry paths one more time (just being anal here)
11. Delete your old profile (C:\User\Mark)
12. Done.
Final Note: Under Win 7, if the “Windows Media Player Network Sharing Service” is running you may get a file in use error when attempting to delete your old profile. To fix this, simply stop the service first, delete the profile and then restart the service.
I’ve been doing this for years and it’s completely reliable.
Hi Mark,
I thought Keithius post was excellent but a little bit ’scary’ for me, however you approach seemed more straightforward. I followed your process and everything seems to have worked fine but I have a problem with icons in Windows Explorer continually corrupting. I can fix it by deleting the iconcache database but it keeps recurring. My suspicion is that something has gone wrong during the registry changes I made – in spite of all my careful attention! Is this something that you’ve come across?
Thanks!
Thanks a bunch. It worked great for me. No problems. Using win7 enterprise and have a ton of extra progs loaded and it worked just fine. I tried a copy first and not all the files copied but the move worked great. Just logged back in and worked like buttah. Thanks Again.
Shannon
tried it, but when i log back into the account it says it is setting up a temp file for me that will be deleted when i log back off.
my files look like this c:\users\int gds d:\users\int gods
are those spaces fine, i tried it both ways, forgot which way said it was all good, path created BUT the problem is that when i log in, like i said, it just says it is creating temp folders!
any suggestions
Check the permissions on the new folder, and make sure you copied everything – look for “hidden and system files” – those are the only suggestions I can think of right now.
I noticed in Win7 a set of junctions in the original profile folder (C:\Users\Greg). I manually recreated these in the new location (D:\Users\Greg). However, all of these manually created junctions are plainly visible whereas the original ones were hidden.
ATTRIB doesn’t appear to be able to hide the manually created junctions, nor do the original ones have the H attribute set. So there is something else going on that identify these as special junctions (e.x. NetHood, PrintHood, Start Menu, Templates, etc).
QUESTION: What is the process needed to set these manually created junctions to have the same characteristics as the originals?
I couldn’t find any way to move the originals, nor do I think that would have worked.
I don’t know – I don’t have ANY junctions like that in my original profile folder. So I’m not sure exactly what it is you are seeing, nevermind how to re-create “hidden” junctions.
Followed the instructions above (Win7) seems to work fine untili I try to download files in IE.
Tryed adobe reader but got error not finding adobe download site. Tryed with a user NOT moved and then it worked fine, come up with a question about installing ActiveX adobe dowloader that did not show up on the moved user.
See my comment above. In short, IE no longer has write permissions to Temporary Internet Files under \ because the folder (and a bunch of its parents) are owned by Administrator. You need to reset the ownership of those folder (in fact, the easiest is to reset the entire directory hierarchy under \. Instructions a few posts above.
Hi, just tried this and was succesful. I must say I made a little combination of another, very similar, method described here:
http://www.tips5.com/how-to-relocate-user-profile-folder-to-other-drive-in-windows-7
and added a small change myself due to some copy problems I had.
So,
1) Create a new admin account (with password)
2) restart PC and hold F8 until you get option to start in safe mode. You should also see an option to repair windows. Choose that option. After a little loading time you’ll be asked to login (as the admin you just created) and get a menu.
3) Select “Command Prompt”
4) Use the command prompt to find out which drive letters are now associated with your Windows drive and the drive you want to move your profile to. They will be different now that you´re in repair mode!! In my case E: and D: respectively.
5) use robocopy to copy all the files from your profile (robocopy will also copy all permissions) with this command:
robocopy /MIR /XJ /B /R:1 /W:1 E:\Users\[Accountname] D:\Users\[Accountname]
(the /B option will make sure that any “access denied” copies will not appear and files will be copied. This happened to me on all *.tmp files in AppData\Temp)
Make sure that robocopy reports no failed copies (FAILED column = 0)
6) Then remove the old profile folder with:
rmdir /S /Q E:\Users\[Accountname]
7) Create the Junction with:
To verify, now go to the folder on the system drive and “dir” inside E:\Users. You will see the link made.
mklink /J E:\Users\ D:\Users\[Accountname]
9) Restart and enjoy!
Worked like a charm for me.
greetings
PietPara
Thanks for posting an alternative method!
I followed these instructions, and they did work. The key is to specify /XJ as a parameter to robocopy (else it tries to follow the junctions and ends up in recursive hell). However, with /XJ specified, the junctions which windows had created to make older programs work (ones which hardcoded links to “My Documents”, for example) will be gone. In order to preserve these, I first enumerated all the junctions in my user profile using “dir /al /s > junction_list.txt”. Then, I ran robocopy and moved the folder structure. Following this, I recreated the junctions in junction_list.txt using mklink.
I had to also take ownership of the entire new folder hierarchy explicitly, else IE would refuse to download files (and, I’m sure, a bunch of other programs would have failed either silently or catastrophically).
I don’t use RoboCopy myself, so I can’t provide any feedback or guidance on the “right” switches to use with it – so thanks for posting this comment to let people know!
Thank for putting this info together. I found the comments very valuable as well. I was able to successfully move C:\Users to D:\Users, place a directory junction at C:\Users pointing to D:\Users, and rename C:\Users as a backup before placing the link to D:\Users. Here’s my procedure:
Objective: Move C:\Users to D:\Users. Place a directory junction at C:\Users pointing to D:\Users so Windows does not realize the Users directory has been relocated to a different disk volume. Rename C:\Users as a backup before placing the link to D:\Users.
Method:
1. Create D:\Users directory and set security to match C:\Users
2. Create two admin accounts that will be used to move data to D:\Users
3. Boot into Windows Safe Mode to copy all data from C:\Users to D:\Users
4. Copy all data from C:\users to D:\User. Do *not* copy directory junctions. Use admin account #1 to copy all data except data for admin account #1. Use admin account #2 to copy data for admin account #1. Windows uses directory junctions throughout the Users directory structure, and there is no known method to copy directory junctions as all data copy programs distributed with Windows copy the contents of the junction instead of the junction itself. Trying to copy the directory junctions in C:\Users will lead to a recursive loop and failure, so don’t even try it!! Use the following command to copy each directory in C:\Users to D:\Users:
Robocopy C:\Users\[Directory] D:\Users\[Directory] /e /secfix /copyall /b /sl /xj
This will successfully copy all data and security settings. The only remaining data not copied will be the directory junctions.
5. Manually create junction points in D:\Users. First list all directory junctions in C:\Users and save to a file: dir /al /s C:\Users > C:\junctions.txt. Next manually create each junction in D:\Users.
For example:
a. cd d:\users\default
b. mklink /J “Application Data” c:\ProgramData
Note: You do not need to create the junction points for the admin accounts, as those are just temporary accounts used to move data to D:\Users. When this procedure is finished, you should delete the temporary admin accounts and create new accounts. Creating the directory junctions in the Default directory will ensure all new accounts get the correct junctions. On my system, I needed to create the following junctions:
D:\Users – 1 Junction
D:\Users\All Users – 6 Junctions
D:\Users\Default – 16 Junctions
D:\Users\Public – 3 Junctions
There is also a symlink in C:\Users that needs to be in D:\Users. The robocopy command with the /sl option will correctly copy the symlink from C:\Users to D:\Users. Of course, if you have active accounts you are copying, you will need to manually create directory junctions for them as well.
When you create the directory junctions in D:\Users, don’t worry about setting the security to match the junctions in C:\Users. The important point is to make sure all the directory junctions you create in D:\Users are set as hidden files.
6. Now, we have successfully copied all the C:\Users data to D:\Users and manually created the junction points. We are ready to rename C:\Users to C:\Users-bak and create the junction link between C:\Users and D:\Users. The C:\Users directory is always in use, and will not allow you to rename it, so we need to boot from CD and use the recovery command shell. First, boot your system using your Windows 7 media and select “Repair Your Computer”. Next, select your Windows OS to repair and then “Command Prompt.” Once in the command shell, your C volume will be mounted on another drive letter. In my case, C: was mounted on E: and D: was still be mounted on D:. You can now rename the Users directory and create the directory junction to D:\Users:
a. Rename E:\Users E:\Users-bak
b. Mklink /J E:\Users D:\Users
7. Reboot your system, remove your temporary admin accounts, and create new accounts. You’ve done it! C:\Users has been moved to D:\Users and a directory junction is in place pointing C:\Users to D:\Users. You have your original C:\Users renamed as C:\Users-bak, so you can always reference it if you forgot something or need to back out to your original configuration.
I just found out that Norton Ghost 15 has a disk copy feature. I tested a disk copy of my C: drive to an external hard disk, and it copies everything correctly, including directory junctions and security settings. This is a good option if you have a blank target disk, as you won’t have to manually create the directory junctions. You’ll just have to delete all the stuff it copies you don’t want.
I have Norton Ghost 15 and had tried a backup/restore of the user directory, but it didn’t restore the directory junctions. Nice to know the disk copy works.
Yeah, Ghost has always been a nice disk copy utility, though I don’t like having to pay for it (I use the Gparted LiveCD myself, though that’s not perfect either).
I expect any disk copying tool would copy junctions and security settings – after all, these utilities usually do a bit-for-bit copy.
I expect they’d have some troubles, though, if there were junctions to a different physical drive though… I can’t see any way for a disk copying utility to handle those gracefully.
Hey, I had to comment, i just installed windows 7 and wanted my ‘personal’ folder to be on my second drive, i thought it must be easy so had a quick google, i soon thought it was not going to be easy then i saw this massive page talking about some crazy stuff and even reinstalling to get it changed so i thought forget it,
I then clicked my personal folder window then selected and cut all of the folders including the desktop, and pasted then in a folder i created in my username at the root of my data drive. Done, all of the links now pertane to folders that exist on my data drive……..cant belive it coudl be so simple, i had to laugh
I do have one slight issue i seem to have videos, pictures and music folders on my c: but they are not the My videos , My Pictures & My Music that the links point to those are definately on the data drive, i tried to delete but i said i didn’t have permission even though i am admin but i am sure i get rid of them, its just a bit untdy atm as they appear alongside all of the ‘My’ folders when i click the personal folder link – but this my just be something on my machine anyway, maybe an issue from another program.
So to recap if you have just read all that about fixing it, JUST TRY CUT AND PASTE TO NEW LOCATION.
Im on build 7229 x86 and it worked for me : D
I have to say I’m a little skeptical – it should be impossible for you to copy your profile folder like that while you are logged in, as there are files in there that are “in use.” But perhaps Windows 7 makes better use of things like Volume Shadow Copy to allow moving in-use files; I don’t know.
Unfortunately I don’t have Windows 7 (yet) so I can’t verify your claim – perhaps someone reading this could independently verify this? Again, I don’t mean to dismiss your claim, but it is a little hard to believe. (If it works though, then thanks for sharing!)
Ok, I rebooted and then loaded the libraries page, in the properties i removed the links to the old c: locations just leaving the new data drive locations.
When i checked back in my user folder on C:\ the 3 folders were gone (i did have a new tracing folder not sure what it is possibly MSN as i just installed it) but anyway its sorted.
actually just checked it appears in both locations when i open MSN, not a problem though – i hope this info saves some stress and time
Anthony
You can do the same for the public libraries too, cut and paste all ‘Public’ folders from ‘Public’ Link to a new folder called public on the data drive then go to the public libraries page and add the new location for ‘recorded tv’ remove the old one and thats sorted too !
Found this post today…have been doing this MKLINK trick for 2 years now.
First with Vista and now on Windows 7
I have had no problems, except finding out the doing it the right way
Loging on as Administrator is my secret to succes.
Also rebuild the exact NTFS inheritance ‘credential’ tree manually.
PS: Did have a Creative SB driver that blew away the symbolic link. No real harm cause it can be simply re-created…but you do get scared when your profile is ‘missing’
I found this all a little scary so did some more reading. Mark Russinovich’s article in Technet Junctions V1.05 seemed relevant.
I notice that PietPara used mklink to create his junction. I have downloaded junction from techNet.
Has anyone tried this?
Mark Russinovich’s “junction” tool is for versions of Windows that don’t have mklink (i.e., Windows 2000, XP). But both junction and mklink do the same thing.
Remember, the Windows NT file system (NTFS) has supported junctions all along (well, at least as far back as 2000), but Microsoft didn’t include a tool for creating junctions in Windows itself until Vista. So that’s why the “junction” tool exists.
Thx. I will use mklink. Greatly appreciate your support!
There is a minor typo in PietPara’s procedure.
The mklink instruction is incomplete
The line should read:
mklink /J E:\Users\[Accountname] D:\Users\[Accountname]
The first [accountname] was missing and the error message is not explicit, only says directory exists!
Worked perfectly
You’re right – thanks for the correction!