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
    2010-03-31T01:01:10+00:00

    If you move all of the user data in the appdata folder from your SSD to your spinning disk, you actually will gain little to nothing in the way of performance.  

    This is because the OS and other applications store certain settings there that are referenced constantly, so moving all of this to the slower drive will hinder the performance of Windows as a whole.

    If your concern is the aggravating default in Outlook where the PST/OST files that are deposited in the appdata folder and are becoming space hogs, I suggested a solution to that below.

    Other than that, and OneNote backups if you use that program, the appdata folder consists of essential system files needed for your personal account, so I don't understand the logic of moving them away from the system drive.  I consider the contents of the appdata folder to be part of the operating system.

    Was this answer helpful?

    0 comments No comments