Continuing on with my workarounds for moving system files around, today, I decided to look into moving my user profile folder to a different partition. While IIRC, it used to be possible (in earlier versions of Windows) to do this by setting the home folder to an appropriate value in the user management snapshot, that did not work for me.
Searching on the net came up with a lot of nonsense, solutions with registry modifications and so on. A little more digging later, I came across this immaculate solution which also introduced me to the robocopy and mklink commands which I'm guessing were introduced in Vista. While it worked like a charm, I do want to repost the solution here with a couple of caveats which might make things difficult for the inexperienced. I've also expanded some of the steps in the interest of completeness.
- If your files and settings are precious to you, then prior to doing anything, back up everything in your profile folder and indulge in all the precautionary steps you can think of.
- Enable the administrator account for your PC using the following steps:
- Go to your control panel and click on Administrative Tools.
- Within, double-click on Local Security Policy.
- In the resulting window, expand Local Policies and then select Security Options.
- The first option that should come up in the list of options on the right should be one titled Administrator account status. Double-click this option.
- In the ensuing dialog, select Enabled and click on OK.
- The User Accounts management control panel should now allow you to set a password for the now visible Administrator account. Setting a password is recommended, even if we are only going to be using this account temporarily.
- We are going to assume that the source profile folder is located at
C:\Users\Foo. Since we are going to be moving stuff around it's best to keep things slim and tidy. To this end, clear all your browser caches, windows temporary files and so on for this profile.
- In the target location, create an appropriate folder. In this example, this location is going to be
- Log out and log back in as the administrator.
- To avoid situations in subsequent steps where active services are denying access to files in the profile folder, it is best to disable some of the services running. This step might be optional for some.
- Go to your control panel and open Administrative Tools. Within, double-click on Services.
- To easily access running services, click on the Status column header a couple of times to sort the list of services based on their current status.
- In my case, I had to stop the Windows Media Network Sharing service. To do so, right click on it and click on Stop. While I was here, I decided to also disable other tell-tale services that I thought might interfere with the operation. I went ahead and also disabled the User Profile Service. These stoppages are temporary and these services will resume after a reboot.
- In the Start Menu's search field, type
- Here type
robocopy /MIR /XJ C:\Users\Foo G:\Users\Foo. This will take a while to complete. If you run into access denied errors, you might need to disable a running service as outlined earlier.
- Once this is done, check that the copy operation has gone through successfully. You can now either rename or simply delete the current profile directory at
- Now, we can create the Windows equivalent (junction) of a Linux symlink by typing
mklink /J C:\Users\Foo G:\Users\Foo. This should point the default location for the profile directory to our new location and Windows will be quite oblivious to it.
- Once this is done, close all windows and reboot the system.
- Log in as Foo and you should find that the profile looks just the same as before except that now it resides in a custom location.
- If everything is well, remember to go and disable the Administrator account created during the initial stages!
I hope that this helps somebody out there!