Not logged in - Login
< back

Move User & ProgramData folders to different drive during clean install

Most of this information was pulled from the following page: http://webcache.googleusercontent.com/search?q=cache:8kyC6zORxQQJ:answers.microsoft.com/en-us/windows/forum/windows_7-files/win7-how-do-i-move-user-folder-to-a-different/565f16a5-e5ed-43c9-8422-4f56aebb296e+&cd=1&hl=en&ct=clnk&gl=ushttp://youtu.be/koST74INsb0

WhenHow creatingto move user profile in Windows 7 to another directory / drive:

    1. After installing windows 7 you will be greeted with a cleanuser install,creation usingprompt thepress combination of an SSD system driveshift+f10 and ayou conventionalshould disk drive, asget a datacmd drive,window. there
    2. is a way to "move"Copy the Users folderProfiles, (normally,Program C:\Users)Files andAnd ProgramData Folders onto the hidden ProgramData folder (normally C:\ProgramData) to the conventional disk, or data drive, using an answer file, or unattend.xml, for an unattended installation, as mentioned above. For an individual doing a single, one-off installation, trying to figure out how to create an answer file for a completely unattended installation, just to accomplish this one small task, is way, way too much trouble. It's also not necessary.

      It is possible, during the course of a conventional, interactive installation from an installation disc or USB thumbdrive, to enter what is called, "Audit Mode", before the Computer is named or a Username created, and accomplish the necessary re-assignment.

      1.) Do a conventional installation. If you are using an SSD, at the point in the installation process where you are asked wherePartition you want to installuse.

      1. Windows,robocopy you"C:\Users" should"D:\Users" use/E Drive/COPYALL Options/XJ
      2. to remove any partitions on the SSD, before selecting the SSD as the target. Do not manually partition or format the drive, prior to installation. Windows 7 will do this, and must do this, because Windows needs to align the logical format with characteristics of the physical drive, and, also, Windows wants a small system partition for its own purposes.

        2.) When the installation stops, waiting for you to give the computer a username and a computer name, DON'T! Press Ctrl+Shift+F3, and the computer will restart in . . . (wait for it!) "Audit Mode"!. Basically, Windows will create a throwaway Administrator account and sign you in, as this throwaway Administrator. Nothing you do, with regard to this temporary user will survive finalizing the installation, but the computer operates normally, and you can install drivers and software. Whenever the computer starts in Audit mode (you are allowed to restart), a GUI version of Sysprep.exe will pop up, offering to restart the computer in OOBE (out of box experience). OOBE is where you were a moment before

        3.) You need to know what drive letter (or folder location) is going to be assigned to your Datadrive disk. So, this would be the time, in audit mode, to figure that out. If you need to partition or format the datadrive, do it now. On the Start Menu, right-click on "Computer" and choose Manage from the context menu, to get to the Computer Management console. In the Computer Management console, under Storage/Disk Management, you will find the tools to change drive letters, partition, etc.

        4.) You need only a minimal answer file. This is an xml file (a text file), created in the Windows System Image Manager application. You can call it whatever you like. I'd suggest: folders.xml. Here's the content of a folders.xml file, which will re-locate Users and ProgramData to D:\

        <?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>d:\Users</ProfilesDirectory>
                        <ProgramData>d:\ProgramData</ProgramData>
                    </FolderLocations>
                </component>
            </settings>
            <cpi:offlineImage cpi:source="wim:h:/sources/install.wim#Windows 7 ULTIMATE" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
        </unattend>

        I am going to imagine a scenario, where you make this file on another computer, and transfer it to the computer, where the installation is being done, using a USB flashdrive, which, when plugged in, to the computer in Audit Mode, is assigned the driveletter U:

        You could probably just copy the text above into notepad and save it as a textfile with the extension, .xml and be good to go, provided you wanted to use d:\Users and d:\ProgramData as your Datadrive locations. (I've used this answer file, successfully; I don't guarantee that it will work for others.)

        5. To use the folders.xml, located in the root directory of your USB flashdrive, plugged in and visible as U:\, you need to open a command prompt, navigate to c:\windows\system32\sysprep and give this command: sysprep.exe /audit /reboot /unattend:U:\folders.xml

        This will cause the computer to reboot, but you will end up right back in Audit Mode. As long as you are still in Audit Mode, the re-location of these folders will not be complete, because the temporary Administrator useraccount still has its stuff in C:\Users and there are still some active databases in C:\ProgramData.

        6.) Now, you need to say goodbye to Audit Mode. Remember that a GUI for using Sysprep to initialize the OOBE shows up, each time you re-boot into Audit Mode. So after you reboot in step #5, you will have your chance to run it. (If this is your personal computer, don't check the "Generalize" box in the Sysprep GUI.)

        7.) Finish your Windows installation, create a permanent username and giving the computer a name, etc. When you are finally up and running, go look at C:\ C:\Users should be gone. C:\ProgramData is probably still there, but it's normally hidden, so you won't see it, until you go into Folder Options and check Show Hidden Files and Folders. D:\Users and D:\ProgramData (hidden) should also exist.

        8.) I like the idea of using Junctions to intercept any program foolish enough to hardcode to c:\users or c:\programdata You'll need to delete or move C:\ProgramData, before creating a Junction at C:\ProgramData pointing to D:\ProgramData. The command line tool, mklink, is useful here. Open a command prompt, and type mklink /? for instructions. If you prefer a right-click GUI tool, check out: http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html

        The following commands might be helpful: robocopy "C:\ProgramData" "D:\ProgramData" /E /COPYALL /XJ

    3. Delete the old folders and create links for User Profiles:
      1. rmdir "C:\users" /S /Q
      2. mklink /J "C:\users" "D:\users"
    4. Delete the old folders and create links for ProgramData:
      1. rmdir "C:\ProgramData" /S /Q
      2. mklink /J "C:\ProgramData "D:\ProgramData"

      After

    5. havingIf createdyou have any permissions issues while deleting C:\ProgramData don't worry about them just try to delete it and make the Junctions,links Iagain believeafter youfirst couldreboot.
    6. useOpen regeditthe registry editor by typing 'regedit' in the cmd window.
      1. To change the program files path navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Wi­ndows\CurrentVersion and edit the ProfileListProgramFilesDir keyand backCommonFilesDir as needed.
      2. For the user profiles you'll need to thego originalto C:\HKEY_LOCAL_MACHINE\Software\Microsoft\Wi­ndows locations. folders.xmlNT\CurrentVersion\ProfileList willand haveagain modifiededit the Folderlistpaths key,as soneeded.
      3. thatExit everythingthe pointsRegistry Editor and the cmd window.
    7. Reboot your computer and you should be good to D:\ instead of %systemdrive%\ or C:\ I'm not sure what the point would be, but you could.go.
    8. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList