Relocating Windows User Data

Quite some time ago I wrote a post about how to relocate the C:\Users and C:\ProgramData directories of a Windows installation to another drive. This is useful for those of us whom want to use a different hard drive for the operating system and keep documents elsewhere. In my case, my OS is installed to a solid state drive that is simply too small to fit all of my documents, music and pictures. I simply needed a better way to store all the data. When I discovered NTFS junctions (aka: reparse points) I realized I could do just that. I could finally put some breathing room between my operating system and my data.

Now that Windows 8 is here (well almost) I realized I was going to need to move all that data over yet again. In previous years, relocating user data was a pain, specifically because of all the reparse points that have to be fixed recreated once the data is copied to the new drive. Making sure you recreate every reparse point can be quite challenging. Moreso, if you miss one it could mean very bad things when you try to boot the system up again. This got me thinking, why not just write a program to do all that dirty work for me? And so I did.

The program is called MoveUserData. It runs at a command prompt and is intended to be used in the Recovery Console (so that security rights are not an issue). Below you will find the program and full source code.

Using the program is quite simple. Copy MoveUserData.exe to a USB drive or CD. Boot the Windows installation disc and go into Windows Recovery mode. Choose Command Prompt from the list of recovery options. Once you are at a command prompt put the CD/USB drive containing MoveUserData.exe into the computer.

Assuming that your Windows installation drive (normally C:) is currently listed as K:, your data drive is D: and that the CD/USB drive is set to E: then you can execute the following commands.

The program will do the rest. Once done, just reboot!

Disclaimer: As stated in my previous article, messing around with your operating system like this is very dangerous. While I have made every effort to ensure the program works as described it is still possible that errors will occur. So make sure to back up your drive first. Use of this program is at your own risk.

Update [October 5, 2012]:
So despite my rigorous testing of the program it appears that it doesn’t actually work in the scenario in which I intended, the command prompt of the Windows Preinstall Environment (installer discs). Truth be told I never actually tested it in this scenario because it would have made development incredibly slow and complicated. Instead I tested using a duplicated data set on a separate pair of drives from my main system. Apparently that was a big mistake on my part since it would seem .NET based applications like mine don’t run at all in Windows PE. Bummer!

An aside: Why on earth would Microsoft develop the .NET framework and market it as the end-all-be-all of Windows’ platform development if they don’t include support in Windows PE? That seems like a huge gap in judgement.

Back to the real issue at hand. Since no C#/.NET programs will work I am rewriting the utility entirely in C++. So stay tuned!

Dissecting the Xyloband

A couple of nights ago I went to the Coldplay concert at the Hollywood Bowl. The show was amazing in every respect but what really grabbed my attention were the wristbands they handed out at the gate. These wristbands immediately lit up and began to flicker to the beat of the music, and coordinated with the rest of the lighting coming from the stage (to see it in action take a look at this video). It was truly impressive to say the least!

Being naturally curious as I am I started researching the little gizmo as soon as I got home. I found this great post on Hackaday that already began the discussion I was interested in; how does this thing work? That quickly led me to the interview with it’s creator, Jason Regler, and finally to the actual patent filed with the USPTO (of which I proceeded to read in detail).

My next step was to actually take the thing apart. I’m lucky to have two of these since my fiance Heather joined me on the occasion.

You can see from the picture above that it is powered by three 3V batteries. The two CR2016 batteries are stacked on the back side of the board while the CR2032 is attached to the front. The circuitry itself seems moderately complex with only two ICs and a number of resistors. The most visible IC is on the bottom left is an Si4313 RF receiver from Silicon Labs. This RF receiver runs in the 240-960 Mhz range. The second IC that is partially visible from underneath the battery clamp appears to be the C8051F980 Microcontroller (MCU), also from Silicon Labs.

And for good measure here is a shot of the back of the circuit board.

It’s a very cool gadget. As I dig a little deeper I hope to be able to turn this thing on at my own will, preferably without Charlie Brown’s help.


Moving your data where you want in Windows Vista/7

Microsoft has graciously decided to get rid of the Documents and Settings folder in favor of the new Users folder in Windows Vista/7. This is nice because not only is it faster to type but its a little more familiar for Unix/Linux users. The one thing I still would love to see in the Windows installer, however, is the ability to choose the location of this Users directory (and heck even rename it). Unfortunately MS does not provide us that ability by default. To get that ability you have to modify the actual Windows installer.

So what if you don’t want to have to re-install the operating system? Maybe you just want to move your data to the place of your choosing without any serious modification to your system. There are a couple solutions out there people have already written about.
They are:

  1. Change the location of each data folder (i..e Documents, Pictures, Music) individually using Windows explorer settings.
  2. Modify the Windows registry to reflect the new folder location

There are a couple of problems with these two solutions. The first solution means that you can only change specific folders such as Documents, Pictures, Music, etc. It doesn’t solve the problem of moving hidden application data or other folders to the new location. It also becomes tedious to do so. Finally, if you want to move all of your user profiles to a new location each user must move the data their self. All in all its not really a solution to the problem.

While the second solution will work it is very dangerous to edit the Windows registry. Making even minor changes to the registry can render your entire system useless. I actually tried this method on Windows XP and was unable to get it working. The problem with editing the registry is that there are hundreds if not thousands of references to the profile folders within it and you may not find every one. Missing even one will prevent Windows or your software from working properly or even at all.

Thankfully I found an easier way.

This method requires that you use the Windows installation disc or use a WinPE 2.0 boot disc. To learn how to create a WinPE 2.0 disc go to Regardless of your choice you will need to get to the command prompt. If you are using the WinPE disc you should be immediately given a command prompt once it has finished booting. If you are using the Windows installation disc you can find instructions how on how to get to the command prompt at

WARNING: The following can be dangerous to your system. As with any hack you should always fully back up your entire hard drive just in case anything goes horribly wrong. If something bad happens to your system don’t blame me… I warned you ;)

For this example I am assuming that you want to relocate your Users directory to your D:\ drive. If you want to place it elsewhere, just change the commands accordingly. Now that you are at the command prompt, type the following commands followed by enter for each:

  1. xcopy /E /H /O /X /Y /I C:\Users D:\Users
  2. rmdir /S /Q C:\Users
  3. rmdir “C:\Documents and Settings”
  4. mklink /J C:\Users D:\Users
  5. mklink /J “C:\Documents and Settings” D:\Users

What you’ve done here is copied everything in the Users directory to the new location and then created an NTFS junction to the new location. You might also notice that Documents and Settings showed up again. You thought Vista got rid of it for good didn’t you? Many applications are hard coded to use the Documents and Settings directory and do not know that Vista has changed this. To make sure these applications still work under Vista Microsoft cleverly created their own junction from the older Documents and Settings to their new Users. You might ask why is it necessary to do change the existing junction then. Well as I discovered myself NTFS for some reason has a bit of trouble with accessing a junction of a junction. So when I first attempted this hack I encountered problems.

You may now restart your computer and you should have successfully moved your entire Users directory to your new location. Congratulations!

Update: After some further testing i’ve discovered something interesting. When using xcopy to move the data files to a new location the special folder icons for Documents, Pictures, Searches, Music, etc. appear to be lost. Also, performance when booting up again may seem slightly slower at first. So instead of using xcopy I tried using a backup program like TruImage to backup the Users directory and then restore it in the location I desired. Using this kept all the special folder icons and the system appeared to be a bit more snappy at first bootup. So while the method described works just fine, for performance and aesthetic reasons I would say backup/restore your Users folder instead. Thus the steps would be as such:

  1. Backup C:\Users using a backup program
  2. Restore the C:\Users to your new desired location (example: D:\Users)
  3. Start WinPE or Windows Installation disc command prompt
  4. Using the command prompt
    1. rmdir /S /Q C:\Users
    2. rmdir “C:\Documents and Settings”
    3. mklink /J C:\Users D:\Users
    4. mklink /J “C:\Documents and Settings” D:\Users
  5. Restart

Update (Oct 02, 2012): After spending some time working on a new install recently I discovered that robocopy is a perfectly suitable replacement for both xcopy and a backup program. In my testing I found the following command options work perfectly to create an accurate copy.

robocopy /B /COPYALL /MIR /XJ <Source> <Destination>

It works so good in fact that I use the command internally in my new MoveUserData utility program I wrote to automate the whole process. I have detailed the new program in an article here.