Overclock.net banner
1 - 16 of 16 Posts

Rubers

· Banned
Joined
·
6,015 Posts
Discussion starter · #1 ·
I was reading around about doing this today and just knew there had to be a better way than using the "Location" aspect of the Windows Vista/7 user folders. I've also tried doing this using Symbolic Links, which worked great except for AppData and ProgramData - This guide sorts that out too. There was also the problem of programs that have hardcoded C:\Users and C:\ProgramData into them - This addresses that too.

You may want a Smartphone,Tablet or laptop handy to refer back to this guide just in case.

Clean Install Method
  1. Before performing a clean install you need to copy this file either to a USB stick, CD or any other kind of Removable Media. You may even e-mail it to yourself, but you need this XML document first:

    Copy the following text into notepad:

    Code:

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
        <settings pass="oobeSystem">
            <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <FolderLocations>
                    <ProfilesDirectory>E:\Users</ProfilesDirectory>
                    <ProgramData>E:\ProgramData</ProgramData>
                </FolderLocations>
            </component>
        </settings>
        <cpi:offlineImage cpi:source="wim:I:/sources/install.wim#Windows 7 PROFESSIONAL" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
    </unattend>
    Now you need to change some things to suit your installation:
    Quote:
    processorArchitecture="HERE"
    • use x86 for Windows 32bit
    • use amd64 for Windows 64bit
    Quote:
    wim:I:/sources/install.wim#Windows 7 PROFESSIONAL"
    Change this to whatever version you're using, such as:
    • HOMEBASIC
    • HOMEPREMIUM
    • PROFESSIONAL
    • ENTERPRISE
    • ULTIMATE
    Quote:
    Quote:
    E:\ProgramData
    Look for these two lines and change the drive letter with that of the desired drive. Here I'm using my E drive.

    And finally, remember this line?
    Quote:
    wim:I:/sources/install.wim#Windows 7 PROFESSIONAL"
    Change the bold and underlined part to the letter of the drive containing your Installation CD or USB. In my case it was my USB, which was drive I (i) but this could be drive D: for your CD drive or whatever is relevant to your setup.

    When you've finished that, save the file as an XML document. Save it as something you will remember and is easy to type, I chose "relocate.xml" Remember to change "save as file type" to "All Files" as the image below:

    377

    Now copy that file to the removable media you have prepared, or even e-mail it to yourself.

    You should also download LinkShellExtension (32bit or 64bit) while you can and have them handy for when you're in your clean install.
  2. If you're using an SSD for your Windows drive disconnect any mechanical HDD's and begin a clean install of Windows. We'll reconnect your other drives alter because we'll need one of them, at least, in order to move the user profiles to another drive. If you're not using an SSD, perform a clean install.
  3. When the install is complete and you are at the screen that asks for a username and computer name DON'T do anything here. Do not go forward or put in a username & computer name. Instead, press CTRL+SHIFT+F3. Your computer will reboot (this is normal). When it's rebooted you will be taken to a desktop. This is Windows Vista/7 Audit Mode which OEM's and SysAdmin's use to pre-configure a Windows install before deployment. You can install some drivers here if you need to but I'd suggest waiting. If you e-mailed the XML file to yourself then you may need to install network card drivers. You will see a Window also that says "System Preparation Tool" in the title close this by clicking cancel or the cross.
  4. If you are using an SSD drive for this guide, shutdown the system, reconnect your drives and reboot the system. You will be taken back to where you were before you shutdown. Close that Sysprep window and continue the guide.
  5. Open up the Command Prompt by typing cmd into the Windows start menu, or finding it in the Accessories folders of the start menu.

    Type:
    Quote:
    c:
    cd\Windows\System32\Sysprep
    Then type:
    Quote:
    Sysprep.exe /audit /reboot /unattend:I:\relocate.xml
    You need to adjust the bold underlined part to where ever you put the XML file we created earlier. In my case, again, it was on my USB stick which was drive I:\

    A small Window should pop up that says: "Processing cleanup phase Sysprep plugins" when that's finished the system with reboot.
  6. When the system has finished rebooting You will be again greeted by the previous System Preparation Window. This time, click ok and the system will again reboot! Don't click or change anything else.
  7. Your computer will now boot for the first time (again, lol) and you will be asked to choose your keyboard settings, username, computer name and product key information. This time you can enter them normally and continue to the Windows desktop! Check your C: drive there should be no user folder and it should now be on your chosen drive! If the user folder is still there or you can't log in you did something wrong in the XML file!. Before you install ANY programs we need to deal with those hard coded programs that may crop up!
  8. Install Link Shell Extension (32bit or 64bit).
  9. Once Link Shell Extension is installed navigate to where ever you located the users folder. Right click on the Users folder and choose "Pick Link Source" from the right click menu. Now move over to the C drive and right click in an empty space (avoiding any folders that are in there) and choose "Drop As --> Junction".
  10. Next can be tricky. It was for me but it may not be for you. In the C Drive, again, we need to show hidden files and folders. Click "Organize" and choose "Folder and Search Options. Choose the "View" tab and find the option to enable "Show hidden files, folders and drives" and then choose "OK". Now you should see a hidden folder called "ProgramData" in your C: Drive. If you don't, that's fantastic and you may go back to where ever you relocated the ProgramData folder it in the XML file and create a Junction link as we did just now with the Users folder. If, like me, you did indeed see a copy of ProgramData in the C: drive... try to delete it. If you can, good, create the link as I just mentioned. More than likely it won't allow you to and we'll have to delete it the hard way
    frown.gif
    Onto the next step.
  11. Reboot your computer into Safe Mode. To do this, reboot and hammer the F8 key until you're greeted with options for safe mode. Choose "Safe Mode with Command Prompt".
  12. Once at the command prompt type this:
    Quote:
    c:
    rmdir /s ProgramData
    Type Y and press enter to confirm

    Now type:
    Quote:
    If ProgramData is gone, we can move on to the next step of creating another Junction. We might as well do this from here since we can
    biggrin.gif


    type:
    Quote:
    mklink /j C:\ProgramData E:\ProgramData
    Change the bold part to suit where you relocated the folder as many times before during the guide. After that is done we've finished! The only thing left now is to reboot the system. The easy way of doing this is going to be to type:
    Quote:
    Which should start Windows Explorer. Once that's done you can reboot the system!

    That's it, we've done!
Non-Clean Install Method Use at your own risk.

If you don't want to perform a clean install you can do this but it's highly recommended you do a clean install to make sure everything goes smoothly. Read the guide above so you understand what we're doing and then come back here and do the following:

Create the XML document as in the guide above and put it somewhere like a USB stick or e-mail it to yourself.

Open a command prompt window with administrator privileges (right click and choose "Run As Administrator")

type:
Quote:
cd\Windows\System32\Sysprep
then:
Quote:
Sysprep.exe /audit /reboot
This will reboot the system to the Audit Mode and you can continue from step 5.

The difference here is when you finish and reboot you will be again taken to the welcome screens that ask you to put in your username and computer name as the system believes it has just been booted for the first time. Choose a username like "Test" because yours is already taken - you may want to keep the same computer name though, you can use the old one that's ok. Now once you're at the logon screen, ignore the test account and just use your normal one. If everything went ok your user folders were were moved.

I cannot guarantee your stuff will have been moved or that you can even get into your account. I lost access to the user account this way, but others reported it worked ok for them. I do not recommend it at all. Fortunately the user account stuff is retrievable if you log into Safe mode and use the built-in administrator account to mess with the registry and relocate your files, but it was a hassle. Use at your own risk.

You may also try the Profile Locater software someone mentioned found here.

I read a number of guides to get all this information. Each one had a slightly different take but I think this one works the best!
 
after spending too much time on 4chan, i pretty much ignore any and all advice that begins with "copy+paste this into notepad".

good guide nonetheless. wish it had been available 3 months ago; i followed a terrible one and had pretty serious issues later on. lost a bunch of music and other files.
 
Discussion starter · #3 ·
Quote:
Originally Posted by macsters View Post

after spending too much time on 4chan, i pretty much ignore any and all advice that begins with "copy+paste this into notepad".
good guide nonetheless. wish it had been available 3 months ago; i followed a terrible one and had pretty serious issues later on. lost a bunch of music and other files.
Haha, could be worse and it could be "use this file that's totally legit!" but yeah this is the best method I've come across. I've tried symlinks and the ye olde "right click, location" methods but this has moved everything for me. The symbolic links towards the end also cover any dumb programs that have C:\Users\ hard coded into them. I'm working on integrating this into my install iso so that I can do this every time I perform a fresh install unattended without having to go into Audit mode.
 
Can't you just use that ntfs junction thing?

Sorry for bump btw, but as this is a guide it should be fine.
 
Quote:
Originally Posted by SkylineLvr View Post

How can I change the script to include the program files and program files (x86) folders too?
It may be possible, if you know how to use the Windows Automated Installation Kit, but on a SERIOUS preface; before you even attempt it. IT IS NOT WISE TO MOVE PROGRAM FILES (32/64) OFF THE WINDOWS DRIVE. Aside from it being a peformance loss (SSD vs. HDD), it would probably end up causing horrible issues later down the road.

On a side note; I typically use the clean method to move my user profiles directory, but I advise against moving ProgramData. I will be able to provide more information as to why shortly (not on my main rig at the moment, rendering), but there are many, many other folders that move alongside programdata with this method. They are also junction points/symlinks, and without relinking them after the move, some things MAY experience issues down the road.

EDIT: As one minor recommendation, if you are installing from USB, and you know the absolute volume lettering beforehand, you can just name the file "unattend.xml" and put it in the root directory of the memory stick. Windows will auto-audit and never even get to sysprep mode. You also avoid a possible registry leak error, that may or may not happen when moving USERS with audit mode.
 
I ended up deciding not to move the Program Files folders. I'll just redirect programs that I install to my other drive.

Is it necessary to do steps 8-12? I've followed other guides similar to this, but they don't do steps 8-12. Do I need to do this?
 
You don't -have- to so to speak, but not creating the symlinks will cause issues with certain programs that are hardcoded to use the original location. Media Center for example, it will recreate the programdata folder on the system drive if the link is missing. Though, I don't really see the point in using a third party link program, MKLINK is fairly straight forward when you are just linking folders like this.

MKLINK /j C:\Users X:\Users

Where is is your new location for the folder that you specified during audit mode. Same rule applies for programdata, though you don't have to do the safe mode bit. If you find your old ProgramData folder to,be undeleteable, just open,up the start menu and type in index. Click "advanced" and "rebuild" and you should be able to delete it before you ever restart from audit mode the first time.
 
So I /REALLY/ need to move my userprofiles, as of writing this my C:/ Drive has >500MB Free space, filled up with AppData, userprofiles and etc. however I don't know what you mean in regards to:
Quote:
Change the bold and underlined part to the letter of the drive containing your Installation CD or USB. In my case it was my USB, which was drive I (i) but this could be drive D: for your CD drive or whatever is relevant to your setup.
I bought my machine pre-built from Harris Technology, and though it did indeed come with a plethora of discs and drivers none of them was to do Windows 7; without an install-disk of some kind is it then impossible to do this? When I fired my machine up for the first time it was ready to take me through the set-up and such, presumably then the install is saved somewhere on my SSD? What do I do if this is the case?
 
That's a really nice method! I will give it a shot next time I'm reinstalling windows. I've got another method that I have been using for quite some time that I did a youtube tutorial on. I use it all the time and found it to be fairly easy to explain to other people who are fairly new to system building. It allows for Program Files x64 + x86 to be moved to a different drive without any loss of functionality. (Albeit, I have been informed it does not work on Win 8 so I will need to look into that at some point.)

https://www.youtube.com/watch?v=Unm3VMTMZu4

P.S. I'm not really comfortable talking to the camera so please excuse the mistakes and lack of eloquence please don't tear me apart.
tongue.gif


EDIT: Great Scott! I just realized the magnitude of this necro! My bad, I got here through Rubers' signature.
blushsmiley.gif
 
This may be a stupid question, but how do I know (in advance of installing Windows 7) what drive letters Windows will assign to my devices. I need to know that in order to fill out the Auditmode Script to reflect my actual configuration. I always change my drive letters after Windows is installed, but that will all change once I start a clean install. So how do I know what letters will be used?
Thanks
 
Quote:
Originally Posted by macsters View Post

after spending too much time on 4chan, i pretty much ignore any and all advice that begins with "copy+paste this into notepad".

good guide nonetheless. wish it had been available 3 months ago; i followed a terrible one and had pretty serious issues later on. lost a bunch of music and other files.
hahaha soo true
 
1 - 16 of 16 Posts