Friday, August 27, 2010

Move Windows 7 Users folder to another drive

If you've already installed your operating system and want to move the entire Users folder to another drive use these instructions. This will create a symbolic link which will leave the operating system using the same path to avoid breaking anything pointed to the Users through the C drive. You will still be able to get to this directory through the normal C:\Users path. This is an alternative to making changes with the unattend.xml file on installation.

Moving the Users Folder

1. Copy C:\Users to your secondary drive, or wherever you want it to be located. This works best if you boot into a Linux disc or some other boot drive since windows will lock files while you are logged in. If you have a WinPE disc, you can make all these changes at once.

2. Rename, delete, or move the original folder after making sure that the files have copied. It is difficult to rename that folder while you are logged in to the operating system, so I would do this step while booted to another drive.

3. Log in to the original OS with the built-in Administrator and rename the folder again, or delete any User folder that was created. For some reason the OS treats this folder differently, and maintains the Users folder name. If you don't do this then you won't be able to create a symlink. If you use WinPE, you'll be able to create the link without fixing any of the changes that are made from logging in.

4. Now create a Symbolic Link for the Users folder. This is done in the normal command line by using the "mklink" command. If your secondary drive is E, then the command will probably be:

"mklink /J C:\Users E:\Users"

Don't forget to use the /J tag or you'll have problems!
I accidentally forgot to use the /J tag above, and it created a soft link instead of a hard link.

More on symbolic links:

It should look like this when you're done:

The Users SymLink should look like a shortcut.

I'm sure you can use this for almost any folder in windows. This might be especially useful if you have a lot of data and have a smaller OS drive, or if you want to back up all users data, including application data from one drive (i.e. outlook pst files). I see this being more common since it's relatively cheap to get a relatively small SSD and a large, slower secondary storage drive. Remember that users can still add other folders to their "library" so be careful when making assumptions for the location of data.


Desktop.ini popping up on logon?
It probably looks like this:


go to C:\Users\[user]\Appdata\Roaming\Microsoft\Windows\Start Menu\Programs\Startup and move the file or delete it. Renaming it won't help.

More on desktop.ini problem: