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
    2012-04-12T21:34:06+00:00

    My thanks to all who have contributed to this thread, especially BrianWilder and Kari at SevenForums. I was not aware of Audit mode until I read this thread.

    My goal is to move the Users folder, and, if possible, the ProgramData folder off my system SSD drive, to minimize the daily wear and tear on the SSD drive due to web browsing and other daily and weekly maintenance of the Users folder.

    I am planning a new install of an Intel 520 series SSD in the next few days and would like to make this kind of change at that time, if possible.

    Toward that end, I have been testing a new install on an existing WD spinner.  I used the BrianWilder method and XML file. It appeared to work flawlessly. One sidestep that I took, however,  was to use the Disk Management function to re-arrange my drive letters before re-locating the Users and ProgramData folders via the "Sysprep" command. The reason being that I have a relatively large number of partitions on my system, and I did not want to run into a problem of being unable to change drive letters later because of  the location of the Users folder on the "L" drive. So, the sequence was:

    1. At the Win 7 install "Add User" step, I pressed the "Ctrl-Shift-F3" key sequence, and the machine re-booted. All normal. I was now in Audit mode.
    2. I re-arranged my drive letters, using Disk Management, and did a standard re-start. All normal. I was still in Audit mode.
    3. I executed an elevated command prompt and issued the "Sysprep" command,  per BrianWilder. I used his XML file verbatim.

    Everything seemed to work as described by BrianWilder.

    However, I have since encountered a problem with the Virtual Store mechanism of Windows 7 - hence this post.

    When the initial install completed, I deleted the "C:\Documents and Settings" junction and created a new one to point to my "L:" drive. I did the same with "ProgramData". All searches of the registry indicated that all instances of "USERPROFILE" pointed to the L:\ drive. 

    I updated Windows 7 with the latest patches. It took 7 - count 'em - 7 passes to apply all updates. During this process, there was not a single indication of any issues with the move of the User and ProgramData folders.

    I then decided to start installing some programs, and the first I chose was Irfanview, an image editing/slideshow program I have used for many years. I chose this because it writes to the "Program Files (x86)" folder. On an unaltered Windows 7 system, the first invocation of the program which causes it to update its ".INI" file, will result in the creation of the "VirtualStore" folder or an entry therein in the "Users\UserName\AppData\Local" path.

    On my altered system, this did not happen. In fact, nothing happened. The ".INI" file was not updated, and no indication of any kind - that I could find - was noted in any system log, including none of the Event logs. And, because the ".INI" file was not being updated, Irfanview does not function as intended, and is pretty much hobbled.

    Of course, I can run Irfanview in compatibility mode, and get by the update of the ".INI" file, but I would prefer that this part of the system work normally, without the need for compatibility mode.

    Since a lot of the changes made in Windows 7, as compared to Windows XP, deal with UAC, and maintaining the integrity of the system, I am bothered by this particular anomaly. And, more importantly, if this function doesn't work, then what else does not work properly, thus corrupting the whole system integrity process. I do not currently have any sort of test tools to verify the proper functioning of the UAC architecture.

    So, any thoughts on this would be appreciated. I do not wish to proceed further without some sort of resolution of this problem.

    Thanks in advance for any help.

    Donald

    P.S.

    1. A check of the ACL settings for the relocated Users folder and other folders in that path seemed to indicate the settings were identical to an un-altered system, except for the drive letter.
    2. A "SET" command displayed environment settings that appeared to be identical to an un-altered system, except for the Users folder and ProgramData folder values, which indicated the relocated drive letter.

    Was this answer helpful?

    0 comments No comments