Skip to main content
The 2024 Developer Survey results are live! See the results
title was misleading
Link
Shevek
  • 16.7k
  • 7
  • 48
  • 76

Windows 7: Moving System Folder locationsProgram Files location during install using unattend.xml

Source Link
Shevek
  • 16.7k
  • 7
  • 48
  • 76

Windows 7: Moving System Folder locations during install using unattend.xml

I am planning on using an unattend.xml to create a Windows 7 Ultimate 64-bit setup with Users and ProgramData on a 2nd drive.

I have found many samples of how to do this (see below).

However I would also like to move Program Files to a 3rd drive as well.

i.e.:

C:\Windows             [SSD]

D:\Users               [HDD1]
D:\ProgramData         [HDD1]

P:\Program Files       [HDD2]
P:\Program Files (x86) [HDD2]

I have found that this was possible using unattend.txt in XP but all documentation or examples I find about Win 7 only mention Users and ProgramData, not Program Files.

Is this possible using an answer file?

Sample unattend.xml for Users and ProgramData:

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
 <settings pass="oobeSystem">
  <component name="Microsoft-Windows-Shell-Setup" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="amd64">
   <FolderLocations>
    <ProfilesDirectory>D:\Users</ProfilesDirectory>
    <ProgramData>D:\ProgramData</ProgramData>
   </FolderLocations>
  </component>
 </settings>
</unattend>