60

When I format the computer and reinstall Windows, my first step is move the My Documents folder to another partition. In Windows XP it wasn't enough because the desktop folder and another user folders was in the primary partition.

Now in Windows Vista and 7 we can use junctions/symlinks to "move" the folder to another partition and Windows and another programs will think that the data is in the primary partition.

What the fastest and secure steps to move the Users folder to another partition and to create the hardlinks correctly?

  • 1
    Why (TF) do MS insist on redefining important core concepts in their own special way? Since when do hardlinks work across seperate devices? well since MS decided that's what they'd call it of course! – barrymac Jul 19 '11 at 19:37
  • 1
    @barrymac: Hardlinks have never worked across devices. The OP is wrong. – surfasb Dec 23 '11 at 23:06
  • @surfasb NTFS "junctions" can and do work across partition / volume / filesystem boundaries. I don't remember whether it was Windows 2000 or XP, but I was able to mount a separate volume inside an empty folder on the C: volume, at which point the OS would convert the empty directory to a "junction". I understand that this is not how hard links work on UNIX/Linux, so calling a junction a "hard link" is confusing -- that was barrymac's point. – David Feb 4 '15 at 17:34
  • Here is better answer: serverfault.com/questions/8187/… – JackTheKnife Feb 4 '15 at 22:02
24

mklink /d myuser d:\moved\myuser

On modern versions of NTFS, junction points which you used on XP are replaced with directory symlinks.

Though, I don't really recommend doing this... you're not likely to see any performance benefit.

  • 29
    You miss the step where you copy the users folder... And nobody said anything about performance benefit. The aim is to be able to differentiate backups and restores of system vs. user files, I believe. – Benjol Jul 24 '09 at 13:30
  • I'm installing a fresh windows 7. Can you please give me the exact steps for this? – IsmailS Oct 6 '10 at 6:43
  • 3
    Was there any particular reason for using /D as opposed to /J? – Alex R Dec 23 '10 at 5:24
  • 6
    This should be /J to create a junction point (windows directory hard link). If you fail to do this I have discovered you get funny errors with Adobe Acrobat Reader reporting internal errors as it starts on a symlinked profile. – davefiddes Oct 2 '12 at 20:46
  • This misses the critical step of moving the folder itself -- it's completely nontrivial since it's always in use and has symlinks. serverfault.com/questions/8187/… covers that step as well as explains the consequences. – ivan_pozdeev Jul 24 '18 at 22:47
19

The easiest and most reliable method of getting your user profile onto another (i.e., non-system) partition is to have Windows create it there for you. On Vista, I've used the following steps to have my user profile created on D: instead of C:.

  1. Install Vista and make the first user account "Administrator".

  2. Login. Use regedit.exe to modify the ProfilesDirectory registry key to point to the D: partition.

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
      ProfilesDirectory = D:\Users
    
  3. Create your normal user account, login, logout.

  4. Login to Administrator and change the ProfilesDirectory registry key back to its original value (%SystemDrive%\Users).

  5. Use the account created at step (3) as your normal user account (for application install and use).

This works much better than manually moving the folders and creating symlinks/junctions.

  • 2
    This solution has one problem: If the separate drive disappears, for instance, if it's truecrypt encrypted and you forget to mount it, then Windows 7 will create a temporary profile, which takes significant time, and log you on anyway. In order to use this method for TrueCrypt, you need to create another profile on the C: drive, to mount it, and remember so unset the option that unmounts when you log off that other profile. – Lars D Jan 15 '10 at 11:28
  • 4
    "This works much better than manually moving the folders and creating symlinks/junctions." What? Using NTFS junctions is a fast and clean method for accomplishing this. How could using a second-level OS functionality possibly be better than using NTFS junctions? – user28925 Feb 21 '10 at 5:27
  • 3
    I'm curious, how does it work better than manually creating junctions? – Sasha Chedygov Nov 18 '10 at 22:22
  • @SashaChedygov, I think he's just referring to the fact that you don't have to recreate the junctions (e.g. Local Settings) by other means, especially by hand. Everything's done automatically by Windows when the profile is created. – Cristian Ciupitu Nov 8 '16 at 16:06
5

There is a similar question on serverfault, you should check that out.

But I have had serious second thoughts about this being a good idea.

2

Well - it's taken Microsoft decades to impliment yet another Unix feature with symbolic links. 'Nix had this in the 70's - wonder how long it will take them to work out that the Users folder also could be placed elsewhere? Standard question during a 'Nix install. I always put the Home directory in it's own partition and judging by the amount of questions about it on the net it's a popular question with Windows too. Symlinks are probably the best, cleanest and easiest way to do this. It means that any apps that have the Users folder hard-coded still work without modifications, and it saves all the messy registry hacking. Best one I've seen -

http://lifehacker.com/5467758/move-the-users-directory-in-windows-7

I like to keep the OS and user data seperate both in a corporate environment and at home. Corporately an AD user profile or GPO can redirect the My Docs folder to a NAS/SAN or other network share. Simple reeasons - backups are handled by the data centre or systems guys and not end users, and the PC isn't THEIR PC anyway - it's the company's (so is the data, btw) - so if it dies give them another PC to log in to and they carry on as they were within minutes.

At home, I want to put it on a seperate disk/partition. If my OS fails I want the user data unaffected - makes restores quicker and you also end up with a less fragmented disk as user data changes all the time.

BTW - I also use mirrored disks - having a 1TB+ drive at home is great but it's an awful lot of data to loose if it goes pop! AND you end up with a lot of data to back up unless you use incremental - which is a pain in the arse to recover! And yes - I do back up both online and sync user data to an external HDD as well.

2

Since I use Windows, I move my documents folder to another location.

But, I'm tired to do moving manually, and I don't found any method to do that automatically.

That's why I wrote a script to modify Windows.

This script modifies the registry hive of the default user.

After this change, all new users will have their folders at the selected location.

In addition, the junctions are created correctly.

Can you read this post in English (not my post)

http://www.sevenforums.com/tutorials/117308-user-folders-moving-user-folders-modular-script.HTML#post1008268

or read the Original post, in french : see english post

2

The best way to achive this, is using symlinks ... it worked for me:

  1. First create the profile you want to use
  2. From another administrator account, move the profile folder to another partition.
  3. create the symlink in c:\Users with the name of the account pointing to the profile location.

    mklink c:\Users\Mario d:\Mario
    

And that's all, enjoy!

1

I've recently had the same issue. I wanted to use Microsoft's SteadyState program on a machine with pre-existing user accounts on C:\USERS that I wanted to move on D:. I followed these steps:

  1. I imaged the hard disk to be able to recover from the disaster I expected to experience.
  2. I used Windows Easy Transfer to copy these accounts to an external hard drive.
  3. I deleted the accounts.
  4. I installed Windows SteadyState (works on XP and Vista), and used it to create accounts with exactly the same name as the one I deleted. I created each one on the D:\ partition (SteadyState allows you to choose!)
  5. I started Windows Easy Transfer to restore the previously saved accounts, telling it to copy over the accounts of the same name. It finds them all on D:\ and that is where it puts the copy! Success.

Hope this helps.

1

Using sysprep is the easiest way to create user profiles in a different location. All the other, unofficial ways, such as messing around with junctions and copying or moving files around, gave me "The User Profile Service failed the logon. User profile cannot be loaded." profile error.

1

Warning - we're (apparently) doing it wrong!

I recently asked the Windows about this as I'm having problems using Windows Update after doing the symlinks method on Windows 8. It's worked for a good few months, but now it's seriously starting to show its flaws.

Somebody replied to my question (http://answers.microsoft.com/en-us/windows/forum/windows_8-windows_update/windows-8-update-not-able-to-traverse-symlinks/608dbb4a-6dc8-4cae-b97e-7e806c879431?tm=1377290411294) with the following answer:

Hi

The only supported way to move the User folders to a separate drive is using the Windows 8 ADK.

Windows Deployment with the Windows ADK: http://technet.microsoft.com/en-us/library/hh824947.aspx

Windows Assessment and Deployment Kit (Windows ADK) for Windows 8.1 Preview: http://www.microsoft.com/en-us/download/details.aspx?id=39306

If you have any follow-up questions, please ask on the following forums.

Windows 8 IT Pro Category http://social.technet.microsoft.com/Forums/en-US/category/w8itpro

It might not be quite as severe as this - the Windows ADK just uses sysprep-style answer files for the most part of the configuration. My guess is we can just use sysprep itself after Windows has installed for this. I'll update the answer if I find out any more about it.

protected by studiohack Apr 28 '11 at 23:40

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.