Win7: how do I move user folder to a different drive

Anonymous
2009-08-19T04:37:35+00:00

(with all its registry tentacles taken care of)

Related to this question but somewhat different (using Win7 RC)

I would like to move the user folders for all family members to E:\

What is the best way?

When I cut and paste, I am warned about a bunch of system folders. Also, I don't see the LOCATION tab when I click properties.

Windows for home | Previous Windows versions | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Anonymous
2010-07-18T01:56:46+00:00

When creating a clean install, using the combination of an SSD system drive and a conventional disk drive, as a data drive, there is a way to "move" the Users folder (normally, C:\Users) and 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 where you want to install Windows, you should use Drive Options 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 -- that is, where you create a username and computer name and the installation is finalized.  Don't choose to restart in OOBE until you are ready to finalize the installation.

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 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

After having created the Junctions, I believe you could use regedit to edit the ProfileList key back to the original C:\ locations.  folders.xml will have modified the Folderlist key, so that everything points to D:\ instead of %systemdrive%\ or C:\   I'm not sure what the point would be, but you could.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

Was this answer helpful?

10+ people found this answer helpful.
0 comments No comments
Answer accepted by question author
Anonymous
2009-10-07T18:10:03+00:00

I suspect your question is really "How to I move the My Documents, My Pictures, etc. folders for family members to E:?"

In Win7, as very different from Vista, the "Documents" virtual folder is not a conventional directory. If you open it, however, you can right-click on the "My Documents" real folder and its properties do have the "Location" tab, just as with Vista. The return to "My Documents" a la XP threw me, too, when I first saw it.

The same trick works for "My Pictures" and so on. Note that the Libraries functionality in Win7 is potentially a great tool, but it also opens the door to complete mayhem if you have several family members on the same system: document, picture, etc., folders can be physically anywhere while still appearing under the relevant Library tab in 7. If undisciplined users realize the possibilities, you could experience unexpected "drive full" issues where you least expect them. Best to have a quiet talk with said family about where to create their folders.

Alan

Was this answer helpful?

7 people found this answer helpful.
0 comments No comments
Answer accepted by question author
Anonymous
2009-08-19T13:17:28+00:00

Related to this question but somewhat different (using Win7 RC)

I would like to move the user folders for all family members to E:\

What is the best way?

When I cut and paste, I am warned about a bunch of system folders. Also, I don't see the LOCATION tab when I click properties.

You are really going to need your industrial grade pocket protector for this one. (Geek power on full, Mr. Sulu :)

DISM is a command line utility to add stuff to the new 7 'image' on the setup disk. (Install.WIM, usually) Another utility, ImageX.exe, 'mounts' the image, so Deployment Image Management, and Servicing(DISM) can load a file named 'unattend.xml' to the image. (all this is a part of the Windows AIK)

Download details Windows Automated Installation Kit (AIK).url:

DISM.exe /Image:<path_to_ image_directory> /Apply-Unattend:<path_to_unattend.xml>

The unattend.xml, of course, assigns the ProfilesDirectory location

Taking it down a notch, the setup.exe will load an unattend.xml of you own creation 'on the fly' by running setup with an argument

 setup /unattend:<path>*unattend*.xmlYour running system can adjust this with another DISM command:

DISM.exe /Online /Apply-Unattend:<path_to_unattend.xml>

This assumes you own the AIK, and depends on the creation of the unattend.xml

Best Practices for Authoring Answer Files

Walkthrough: Build an Answer File for BIOS-Based Computers


Rating posts helps other usersMark L. Ferguson MS-MVP

!\[\](http://i3.social.microsoft.com/Image.avatr?size=Large&amp;user=Mark L. Ferguson&amp;id=fb4a4625-6789-43eb-aa48-4a1fbf2df947)

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments
Answer accepted by question author
Anonymous
2009-10-26T19:29:59+00:00

Alan,

That would really not be the question.  The real question is: how do you make ALL the user data reside on a data drive. 

In my case, I am using an SSD drive for the OS and want all the data to be on a data drive.  Yes, you can "move" the Documents, Music, etc folders, but that does not move all the user data.  Doing a clean install from Windows 7 RC to the retail version proved that point when I started tracking down all my data.  There is a lot of user data that, by default, goes in to the C:\Users&lt;user> folder.  I want all that data to be on the D, mirrored drive.  (Yes, the C:\Users&lt;username>\AppData folder DOES have the "Location | Move" option, but it does not work as files are locked by the system.)

From the research I've done, it seems the best solution, as indicated by Mark above, is to use the unattend.xml during the installation.

-Rick

Was this answer helpful?

0 comments No comments
Answer accepted by question author
Anonymous
2009-08-19T14:33:00+00:00

I should add that Andre is right, MS states it here

This setting should be used only in a test environment. By changing the default location of the user profile directories or program data folders to a volume other than the System volume, you will not be able to service your Windows installation. Any updates, fixes, or service packs will fail to be applied to the installation. Microsoft does not recommend that you change the location of the user profile directories or program data folders.

ProfilesDirectory


Rating posts helps other usersMark L. Ferguson MS-MVP

Was this answer helpful?

0 comments No comments

178 additional answers

Sort by: Most helpful
  1. Anonymous
    2013-08-05T00:33:04+00:00

    Thanks Brian, as I reviewed the posts in more detail I noticed I'd missed some things with my first fresh install and decided to give a clean install another shot.

    This process moves Application Data and User Data - but leaves program files on C: with a clean Win7 install.

    Per Brian Wilders recommendation, this time around I used the PDF tutorial Kari put together at SevenForums. This saved me a lot of grief from trial and error issues I had modifying the Brian's XML on my first attempt. Kari clarifies some things nicely in the PDF that had taken me some time to figure out.

    I believe my biggest oversight in the first attempt was not placing Junctions - I believe that leads to a number of problems.  I had skipped Brians step 8 as it wasn't as well documented or easy to find for a general novice hack like myself. This is what I was able to gather from other posts and the steps I took after using Kari's SevenForums PDF to create the necessary Junctions:

        Turned off windows updates so no changes would be made until the Junctions were completed.

        Selected 'show all hidden files, folders and drives' to confirm a ProgramData file still in C:

        Stopped Windows Search Service temporarily. This service kept me from deleting the ProgramData file in C: and not allowing the ProgramData Junction to be created.

        Created the Junctions with the following commands using command prompt:

        mklink /J "C:\Users" "D:\Users"

        mklink /J "C:\ProgramData" "D:\ProgramData"

        Restarted Windows Search Service and turned on Windows Update to continue with the 'clean' install (so far 140 updates and counting).

    I am hopeful having created the junctions should solve what problems I (and others have mentioned I had considered some of Flagstars options but felt more comfortable going with the XML during the Audit setup phase and then making sure I created the junctions correctly. All the registry changes were correctly made using the XML script. And I felt okay moving the default user directory to C: with the Junctions in place.

    Will now test Windows Media Center with a cable TV input, full Adobe CS6 package install along with Steam; will see how it goes.

    I'm hoping both System Restore and Windows Recovery will now function correctly as well if needed.

    Was this answer helpful?

    0 comments No comments