HOWTO: Move Program Files and User Data to another drive, on Windows 7
Danger! Doing this might mess up your computer PERMANENTLY.
I’ve been messing around with my computer, trying to get all my programs installed on a very large software RAID0 drive on Windows 7. (Might also work on Vista.)
I hate the way that Windows by default puts everything on your C: drive, with no option to change it. My Program Files and User directory often account for most of the stuff on my computer, so I like to have them on the biggest (and fastest) drive possible.
To this end, I built a new install of Windows 7 on my machine, which contains 6 500G SATA drives. I installed Windows into a 50G partition on the first drive, and created a software RAID0 (stripe set) volume across all the remaining space. - Doing this is *significantly* faster than using the fakeraid RAID0 controller on my motherboard. (More on this in another post.)
So, I have a 50G C: drive, and a >2TB E: drive. Belive it or not, it *is* possible to get all the data onto the E: drive without problems. It’s best to do this with a new install, or at least make sure you have very good backups though.
Unfortunately, you can’t just move Program Files, Users, etc., while logged onto Windows. Even in safe mode, it’s using your registry data from your profile, and a number of files from Program Files. Some files in Program Files are also owned by “TrustedInstaller” and can’t even be moved by Administrator. There is a way around this though.
The solution involves using NTFS Junctions - basically a magic directory that works as a pointer from one place to another. So, you can create a junction on your C: drive called “Program Files” that actually points at “E:\Program Files”. Any request to a file in “C:\Program Files” actually gets redirected to a folder on E:.
In order to create the junctions, we need a program from Microsoft called… wait for it… “Junction”. You can download it here. Open the zip file, and copy junction.exe to c:\Windows.
Of course as already mentioned, the files can’t be moved whilst Windows is running, even in safe mode. So, in order to move them to another drive, the computer must be started in rescue mode from the original install CD. BUT there’s no access to the Junction command from there. So… The first real step is to create “dummy” junctions, which will be renamed later… As follows:
Open a command prompt as administrator and run the following commands:
- mkdir “e:\Program Files”
- mkdir “e:\Program Files (x86)”
- mkdir “e:\Users”
- mkdir “e:\ProgramData”
Then create the junctions:
- junction “c:\JProgram Files” “e:\Program Files”
- junction “c:\JProgram Files (x86)” “e:\Program Files (x86)”
- junction c:\JUsers e:\Users
- junction c:\JProgramData e:\ProgramData
Of course, you only need “Program Files (x86)” if you’re on 64-bit Windows.
You should now notice that there are 4 junctions on your C drive that point to the empty folders on E:.
Next up, reboot the computer with the Windows DVD in the drive. Ensure your BIOS is configured to boot from the CD drive first, and hit a key when it says “Press any key to boot from DVD” before Windows starts.
When the install system is booted, choose to “repair your computer”. It should find your copy of Windows, so do a manual repair. When prompted, choose to repair using the command prompt.
You should now be able to move the files to the new drive:
Remove the dummy folders as they have the wrong permissions:
- rmdir “e:\Program Files”
- rmdir “e:\Program Files (x86)”
- rmdir “e:\Users”
- rmdir “e:\ProgramData”
Copy the files from C: to E:. After each xcopy command, press D for directory, when prompted
- xcopy /Q /E /B /K /X /H “c:\Program Files” “e:\Program Files”
- xcopy /Q /E /B /K /X /H “c:\Program Files (x86)” “e:\Program Files (x86)”
- xcopy /Q /E /B /K /X /H “c:\Users” “e:\Users”
- xcopy /Q /E /B /K /X /H “c:\ProgramData” “e:\ProgramData”
If you got no errors above, remove the copies from C:
- rmdir /Q /S “c:\Program Files”
- rmdir /Q /S “c:\Program Files (x86)”
- rmdir /Q /S “c:\Users”
- rmdir /Q /S “c:\ProgramData”
Finally, rename the dummy junctions to have the names of the folders on C: you just removed
- ren “c:\JProgram Files” “c:\Program Files”
- ren “c:\JProgram Files (x86)” “c:\Program Files (x86)”
- ren “c:\JUsers” “c:\Users”
- ren “c:\JProgramData” “c:\ProgramData”
After this you should be able to reboot, and if everything has worked Windows should boot normally, but all your files now exist on the other drive.
You don’t even need to change anything in the registry, as anything that points at the default location on C: gets automatically redirected!
“Rock, Paper, Shotgun” guessing game
I recently created a metagame for my favourite gaming website “Rock, Paper, Shotgun”. The idea is that you view the site without author names, and have to guess which of the four authors wrote the post you’re looking at.
It’s a very simple thing, and I threw it together in a couple of hours one evening. You can play the thing here, and there’s a post on RPS about it (yay!), and a forum thread about it too.
The main reason for doing it was to keep my eye in with Javascript stuff, and because a friend said he could normally recognise the author of a post by their writing style. I’m not very good at it. I can usually spot Kieron Gillen’s posts, but my success with the others is pretty random.