How to relocate user profile folder to other drive in windows 7
Posted on May 20, 2009
Bydefault,windows 7/vista put all system data and user data on the same partition,normally it’s drive C.Under this condition we must backup our user data every time we re-install our windows 7/vista.From windows vista ,Microsoft supply us a tool mklink which can create a symbolic link under windows 7 or vista just as the command ln under unix/linux.Below is an example about how to put user data on non-system using mklink in windows 7.
1.Enable administrator account and set a password for it.You can refer How to enable or disable administrator account in windows 7
2.Logoff and login with administrator account
3.Relocate your user data to other non-system partion,for example from C:\users\J to D:\users\J
4.Use mklink to create a symbolic link from C:\users\J to D:\users\J
mklink /D C:\Users\J D:\users\J
5.Re-login use your own account,you will find nothing changed,but in fact your physical user data is on drive D.
6.Done.The next time you re-install your OS ,just use the same user name, remove C:\users\J then run the command of step 3 again then your user data is back.
source:How to move user data folder to non-system partition in windows 7/vista
Popularity: 100% [?]
Related Posts:
» Filed Under Windows
Comments
17 Responses to “How to relocate user profile folder to other drive in windows 7”
Leave a Reply
That’s really help. I didn’t know that use profile folder can be relocate before.
Didn’t work properly for me. Couldn’t load some office programs or live messenger. There must be another way?
Hi.
This works flawless untill you start with step 6. After re-installing your Windows 7, and use your old profile directory on the other disk. You wont be able to login to that account anymore, right after you’re trying to login you get “login off”.
Anyhow, what i found is, when you copy the new profile map with your name (the one you just created while re-installing windows7) , and move that one to the other disk and put the old data in from your previous profile directory. Then it would work. I couldn’t fine anything so far.
Same as when you have made the mklink to the other disk, and instead of copying the profile from C:\ drive to the D:\ drive you create the profile map on the D:\ and copying all the old data in this new created profile map. And when you then try to login on to this account, it would create a TEMP account map in your C:/users/ instead of using the linked directory.
I tested this on Windows 7 Ultimate RTM instead of the evaluation version, and Julian was right. Somehow most of the applications are getting corrupt.
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 profile, let Win7 create the new one, 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.
Thanks
To most easily move all user files and user program files off your boot drive (an SSD in my case), follow these instructions.
FIRST, Create a restore point:
1. Open System by clicking the Start button, right-clicking Computer, and then clicking Properties.
2. In the left pane, click System protection. If you’re prompted for an administrator password or confirmation, type the password or provide confirmation.
3. Click the System Protection tab, and then click Create.
4. In the System Protection dialog box, type a description, and then click Create.
THEN: Go to System Recovery/Command Prompt:
Boot with the Win7 Install DVD, choose language, currency and keyboard, and hit Next.
At the screen with the “Install Now” choose “Repair your computer”
You will be asked if you want to “Repair and Restart” by the System Recovery options, choose “No”.
Then Make sure that Windows 7 is listed as one of the installed OS’s available for recovery, and that it’s selected and then press next.
You will be given a list of recovery tools.
Choose “Command Prompt”.
Find your virtual Windows drive loaded from the Win7 media (probably either C or X), find your actual Windows/SSD drive (D or E) and find your HDD (regular hard drive) (D or E).
In my system normally, C=SSD with Windows on it, D=HDD data drive
Using Win7 Update media, the drives in Recovery mode were set up differently, thusly:
X: virtual/temp Windows drive,
E: actual Windows/SSD drive,
D: HDD, hard drive I wanted to put \Users on.
Some report that System Recovery mode will set up their drives like this:
C: virtual/temp Windows drive
D: Actual Windows/SSD drive
E: HDD, they want to put /Users on.
In the command prompt you will be using Robocopy (NOT xcopy!) to copy c:\Users to d:\Users, then delete the old c:\Users, then make a symlink from c:\Users to D:\Users. Note that you must do these things in order, and you must not have a d:\Users dir before you do this.
NOTE: in the system recovery command prompt window, your drives are not the same as they will be after you leave recovery mode! So adjust the commands below for how the drives are in Recovery Mode, and then they’ll turn out correct later.
I used:
robocopy /mir /xj E:\Users D:\Users
To move /Users from Windows/SSD to HDD.
/mir tells robocopy to mirror the directories, this will copy all files and permissions.
/xj is very important, this tells robocopy not to follow junction points. If you forget this, you will have a lot of trouble.
Make sure no files failed to copy (FAILED column = 0).
Then you must remove the old Users Folder from the Windows/SSD (c:) drive, before you can create the symlink:
I used:
rmdir /S /Q E:\Users
Create a NTFS Junction/symlink that points to the new Users folder:
I used:
mklink /J E:\Users D:\Users
Use the /J switch to create a junction that’s a hard symlink. (If you use the /D switch, you’ll also have to edit the registry, cuz it won’t be a hard link.) Using /J, when Windows looks for the C:\Users dir, it will find it! But it will be on the HDD instead of the SSD. Tricky!
To see the proof of what you’ve created, still in the command prompt window, go into the actual Windows/SSD and do the “dir” command, and you’ll see:
” Users [D:\Users]”
Now restart and you’ll see /Users on your HDD, and there you go. No further configuration or fiddling required. New user profiles will all be stored on the d: drive, as will any user specific data. And it is achievable without any messing about in the registry, searching and replacing values, or having to mess with new profiles in any way. Totally set and forget.
I just ran through ohdannyboy’s procedure for moving the users folder and it worked. Thank you for that. But rather than booting from the install disk, I was able to enter the ‘System Recovery Options’ through the ‘Advanced Boot Options’ screen, (pressing ‘F8′ repeatedly during boot up will get you there). Once in the Boot Options screen, select ‘Repair Your Computer’. This will get you to ‘System Recovery Options’ – at which point you can proceed as per ohdannyboy’s instructions. This method will only work if the original installation created a ‘Recovery Partition’ – which should be present if the system was purchased with Win7 preinstalled.
Once the change was made, rebooting brought me to a warning screen telling me that something got screwed up and gave me the options of repairing or starting normally. I selected the latter and held my breath until my desktop came up normally. The first application I tested was Outlook 2007. It complained that it could not find the .pst file and asked me to point it in the right direction (C:\users\yourACCOUNT\AppData\Local\Microsoft\Outlook\outlook.pst). Outlook restarted mostly successfully – it did not know what to do with some of my rules. The rules where still present, so I simply stepped through them until I got to the ‘Apply’ button. I didn’t actually change anything, but it fixed the problem. Even though the ‘users’ folder was moved to the D: drive, Windows apparently still reports it as being on the C: drive. So I don’t know why Outlook had to be redirected – the path, as noted above, is the same as it’s always been.
Whatever, it works.
By-the-way, it appears that the search index did not need to be refreshed – a big relief. Windows 7 continues to impress me.
imadman and ohdannyboy, thanks a lot for the workaround. It works great.
It’s a shame that Microsoft makes us tanker around instead of providing a neat standardized solution to the very common wish to separate OS and user data…
This is really great. I do agree, with the advances in windows7, this should be something present during the install options AND a utility within the system administration options called something like “User Data Migration Tool”…as a matter of fact, someone could probably make a lot of money writing a program to do this for the folks that don’t like to tinker. Anyways, I’m gonna see if this works for the “Program Files” folder as well. Don’t see why not. Keep you posted.
I followed ohdannyboy’s instructions & though they are excellent it didn’t work for my case. It will work when the target drive has the same letter under the Recovery Environment as in your live system. In my case the target drive is T: You can create a link to D: (the drive letter in RE) but the link won’t work when you go live. You can’t create a link to T:\… because T: doesn’t exist. I got around it by renaming the drive in diskpart in RE(to T:) but I guess using SUBST would work and be easier.
Thanks
Laurie
[...] successfully (and invisibly) done this on Windows 7 64 by using instructions on this forum thread: How to relocate user profile folder to other drive in windows 7 : Tips5 Note: ignore the main article! scroll down to the comment from "ohdannyboy on December 4th, [...]
Just tried ohdannyboy and imadman’s version of this and it worked without any problems or errors, but still early days! Cheers for posting.
In each user folder is a hidden folder called AppData (c:\users\[username]\AppData). Enable hidden files to see this folder (or just enter the foldername in the address bar). This folder (surpisingly) contains a lot of application data. Thus this folder should best be kept on your current system drive (on c:). If you reinstall windows, most of these files should be created again. And if apps are not installed during the second install, unneeded files are taking up space on your data drive.
I know 2 solutions for this:
Move all file WITHIN the user folder (for instance c:\users\[username\pictures). The appdata (and some other folders you're not using) will remain on c:
or
2. Make a link of c:\user\[username] (like proposed). But also make a link d:\users\[username]\AppData back to the original c: location.
Note: Some apps write their data files in appdata (like outlook). The best solution is to move these files explicitly to you data drive. Outlook lets you create another pst file. Or you could move the file. If outlook is started, it will ask you to point to the file.
Forgot to mention that (in alternative 2) the original c: location MUST be in a renamed folder, so it is still located on c:, but under another folder. For instance c:\user\Eddy-AppData
A few warnings if you do this.
1-. Never use system restore. It will @#$@ up the symlink and you’ll have to create another user.
2-. Never use check disk with Windows running. It will corrupt the user and you’ll have to create a new one.
I think the easiest solution to everything is to reallocate the user libraries to a different drive. Using symlinks causes more problems than it’s worth. There are so many thing that can ruin your user when it’s set up this way.
I’ve had to recreate my user about 4 times in 2 years. May not sound bad but sometimes it’s a pain because in most cases you need to reinstall software and reconfigure many things. It’s not as easy as the article suggest in step 6.
I tried dannyboy’s method and I made sure no files were failed however now whenever I try to log on it’s stuck at preparing desktop and once it loads it says I’ve been logged onto the default profile for the system. How can I fix this? Please help!