Moving a user’s files/directory in Windows 7

There was a time during the days of Windows XP, when you could simply right click on your My Documents folder, go to properties and relocate your entire documents folder. When Vista came, it brought with it a number of folders that were now associated with the user. This included Downloads, Searches, Music etc etc. Even though it initially seemed complicated, this uniform structure for each user has eased the backup process. Now, the process I describe is not actually a backup but still the first step that I take to prevent loss of data in the event the drive on which the OS resides, crashes.

I know there will always be another way or simpler method to move your files from one drive to the other but what I describe here is tried and tested – on Vista and Windows 7. The basic logic is to simply create a symbolic link for each user folder inside the “Users” directory in the root of your drive. You may also relocate the entire “Users” folder to another drive or like me, simply relocate the user you want to.

Say, you are user “Peter”. Correspondingly, your folder is C:\Users\Peter (C: being the drive where Windows is installed). Now, you want to move your user data to another drive, say D:.

  1. Firstly, open Control Panel and navigate to User Accounts. You may also execute “control userpasswords” in the Run dialog.
  2. Create a new account. Name it “Dummy” and designate it as an Administrator.
  3. Go to Start and Log Off from the account “Peter”.
  4. Click on the username “Dummy” and login to the newly created administrator account.
  5. In Windows Explorer, navigate to C:\Users. Select the user directory you wish to copy, in our case it is “Peter”. Copy C:\Users\Peter to say D:\Users\Peter. Confirm all prompts that may follow this operation.
  6. Once you have copied the entire folder, navigate back to C:\Users and rename the folder “Peter” to say, “Peter_OLD”. I encountered trouble during this step in Windows 7 where it kept on asking me to try again. A simple workaround is to login to Windows in Safe Mode by pressing F8 again-and-again when the OS starts to boot and selecting Safe Mode from the menu that opens. When Windows boots in Safe Mode, simple open C:\Users and renam the folder “Peter” to “Peter_OLD”. In Vista, you may just have to confirm a series of UAC prompts.
  7. This next step involves using the command line. Fire up the Run dialog box and type “cmd” and press ENTER. When the command prompt opens, navigate to the directory C:\Users. Now, type the following :

    mklink /d Peter D:\Users\Peter

     

  8. Press ENTER. A shortcut named Peter is now created in the directory C:\Users. This is a symbolic link which redirects all requests to the folder D:\Users\Peter.
  9. Restart your PC and login to the account “Peter”. It should display everything normally except for the hidden fact that every file associated with the current account is stored on the other drive.
  10. If everything is normal, then you may simply delete the folder “Peter_OLD” from C:\Users. Open up the User Accounts in Control Panel and delete the account “Dummy” and all files associated with it. If there is an error, just login to the Dummy account, delete the symbolic link “Peter” and rename “Peter_OLD” to “Peter”. If you encounter errors, login to safe mode and try.

The above method works perfectly. The only drawback that I have seen is that Internet Explorer becomes extremely slow and is unstable in both Vista and 7.

The original guide for Vista is here.

4 Comments

  • There are two problems with copying or moving the user folder to the new location:

    First it doesn’t copy the owner/security settings, but that is easily fixed by manually setting them back to the original settings after the copy/move.

    Second, and most important, it will not copy 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.

    • To fix the junctions, 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.

  • Just a quick note, you probably want to check out the following article:
    http://www.windows7hacker.com/index.php/2009/05/how-to-change-user-profile-default-location-in-windows-7/

    Basically the issues you report with IE and probably other apps is related to the erroneous registry keys. Use that method rather than the “link” one.

    As for the files/folders information (e.g. hidden, read-only) you might want to give a try with a zipping program. I’m not sure about the correct outcome for this, but, at least on Unix it’s possible to save all that info in the “zip file”, so when you decompress it you’ll have all back.
    By taking a look at my drives I can’t try this right now (and that reminds me I need to buy more HDs).

    Hope this helps.

  • […] Posted by Nanogrip How does one move user files? It might come in handy for me. http://rahulsarin.com/technology/mov…windows-7-368/ __________________ … […]

Leave a Reply

Your email is never shared.Required fields are marked *