Best Practices for Authoring Answer Files

This section covers recommendations for authoring unattended installation answer files.

Always Validate Answer Files in Windows SIM

The recommended way to author answer files is to create them in Windows System Image Manager (Windows SIM). However, if you use a manually authored answer file, you must validate the answer file in Windows SIM to verify that it works.

Because available settings and default values can change from time to time, you must revalidate your answer file when you reuse it.

Legacy answer files from Windows XP or Windows Server 2003 do not work in Windows Vista.

Avoid Unnecessary Settings

Unnecessary settings can be introduced by inserting a setting's parent node into the answer file.

Windows SIM does not create an empty setting in an answer file. Although unnecessary settings are ignored, they do cost time to parse. Therefore, as you author your answer file, remove any settings that are not required.

In general, it is best to expand down to the lowest level of a component and select only those elements that you intend to set. For the default value, there is no need to include the element unless it is a required element.

Understand Configuration Passes

Configuration passes represent different phases of installation. Understanding what happens during each configuration pass is critical to creating answer files. Review the topics in Methods for Running Windows Setup and How Configuration Passes Work.

Avoid Creating Empty Elements

Windows System Image Manager (Windows SIM) supports creating empty elements in an answer file. You can right-click a string setting type and select Write empty string. This creates an empty element in the answer file. However, some settings support empty elements, and some do not. In some cases, creating an empty element causes Windows Setup to fail. Before creating an empty element, refer to the component setting documentation in the Unattended Windows Setup Reference.

Use Data Images Rather Than $OEM$

The recommended way to add data such as additional drivers or applications is to create a data image and to set the DataImage settings in Microsoft-Windows-Setup for that image. For details on creating a data image, see Create a Data Image.

Although $OEM$ is still supported, it is no longer the preferred method.

Do not overwrite existing files in the OSImage settings. DataImage is used only to add files. You can use DataImage to add data to an existing partition outside the OSImage.

Adding Updates to a Windows Image

Use only the Microsoft-supported servicing mechanisms to update a Windows image.

  • Use Package Manager to update an offline Windows image.
  • Use OCSetup to update a running Windows installation.
  • During installation, you can also configure the computer to automatically download updates from Windows Update.
  • Additional Microsoft-provided servicing technologies can include system management software (SMS) or Windows Server Update Services (SUS).

Never overwrite Windows system files by using $OEM$ or data images. Overwriting system files can corrupt your computer.

If you have additional device drivers to add to a computer, add these drivers offline by using Package Manager. You can also include additional drivers in an unattended installation by using the Microsoft-Windows-PnPCustomizationsNonWinPE and Microsoft-Windows-PnPCustomizationWinPE components.

Specify Language Settings

To change languages by using an answer file, you must generally use the Microsoft-Windows-International-Core-WinPE component. There are two different components in which you can specify language settings:

  • Microsoft-Windows-International-Core-WinPE. Language settings applied during the windowsPE pass.
  • Microsoft-Windows-International-Core. Language settings applied during the specialize or oobeSystem pass.
  • Because some languages require a restart, Microsoft recommends that you configure your language settings during the windowsPE pass because the computer will always restart. If you process language settings during the specialize or oobeSystem passes, the computer might require an additional restart.

Use the Sysprep/generalize command with LocalAccounts to Change Account Information

You can use the sysprep /generalize command and the LocalAccounts settings to change account information about an existing user account.

If you specify the settings in the following example in the specialize configuration pass, all the values of NEWVALUE will be changed. However, MyAccount will retain its security group memberships. MyAccount is considered to be the same account with a different display name, description, and password value.

<LocalAccount>
   <Name>MyAccount</Name>
   <DisplayName>NEWVALUE</DisplayName>
   <Description>NEWVALUE</Description>
   <Password>
      <PlainText>false</PlainText>
      <Value>NEWVALUEBASE64</Value>
   </Password>
</LocalAccount>