Académique Documents
Professionnel Documents
Culture Documents
4/11/13 15:51
https://csw.zendesk.com/entries/21197127-Windows-7-How-do-I-relocate-user-data
Pgina 1 de 4
4/11/13 15:51
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>
https://csw.zendesk.com/entries/21197127-Windows-7-How-do-I-relocate-user-data Pgina 2 de 4
4/11/13 15:51
</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
https://csw.zendesk.com/entries/21197127-Windows-7-How-do-I-relocate-user-data Pgina 3 de 4
4/11/13 15:51
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
https://csw.zendesk.com/entries/21197127-Windows-7-How-do-I-relocate-user-data
Pgina 4 de 4