Update Windows settings and scripts: Create your own answer file

So far in this guide we've provided a few sample answer files that show how to change system settings (such as automating the Windows installation and setting your technical support information) and how to provide additional instructions (such as copying the built-in-administrator profile settings to the default user account).

In this section, we'll show you how to create your own answer file which you can use in the same way. We'll show you how to inject the answer file into an offline image, so that you can efficiently make changes without ever booting the image. To verify that the setting changes took place, we'll boot the image and make sure everything looks OK.

Some settings, such as setting the manufacturer’s support information, can only be set by using an answer file. A full list of answer file settings (also known as Unattend settings) is in the Unattended Windows Setup Reference.

If you're manufacturing PCs for enterprises, those enterprises can control a number of settings by using Group Policy. For more info, see Group Policy.

When you add new settings, you’ll have a choice of which configuration pass to add the settings. Almost all of these settings can be added to one of these three configuration passes:

1 windowsPE: These settings are used by the Windows Setup installation program. If you’re modifying existing images, you can usually ignore these settings.

4 specialize: Most settings should be added here. These settings are triggered both at the beginning of audit mode and at the beginning of OOBE. If you need to make multiple updates or test settings, generalize the PC again and add another batch of settings in the Specialize Configuration pass.

7 oobeSystem: Use sparingly. These settings run after the user has completed OOBE, and can't be verified in audit mode.

We'll show you two common settings:

Microsoft-Windows-Shell-Setup\FirstLogonCommands: Runs scripts after OOBE is complete. These scripts are commonly used to install apps that rely on the user to have already selected a default language. Again, use these scripts sparingly because long scripts can prevent the user from reaching the Start screen quickly. For retail versions of Windows, additional restrictions apply to these scripts. For info, see the Licensing and Policy guidance on the OEM Partner Center.

Microsoft-Windows-Deployment\Reseal\Mode = Audit: Use this to prepare the PC for build-to-order customizations. Later, when you boot the image, the PC will go directly into audit mode. Because we're setting up a script, this command is necessary to keep the script from accidentally running too early. Later, we'll need to make sure the PC is set to boot to OOBE - we'll show you how to do this in the next section, Build to order: Use online servicing to make final updates to individual PCs.

In the Select a Windows Image dialog, browse to and select the base-image file. Next, select an edition of Windows, for example, Windows 8.1 Pro, and click OK. Click Yes to create the catalog file. Windows SIM creates the file based on the base-image file, and saves it to the Windows desktop. This process can take several minutes.

The catalog file appears in the Windows Image pane. Windows SIM also lists the configurable components and packages in that image.

Troubleshooting: If Windows SIM does not create the catalog file, try the following steps:

Make sure you are using a Windows 8.1 version of the Windows Assessment and Deployment Kit (Windows ADK) tools.

To create a catalog file for either 32-bit or ARM-based PCs, use a 32-bit PC.

Make sure the Windows base-image file (\Sources\Install.wim) is in a folder that has read-write privileges, such as a USB flash drive or on your hard drive.

After the image is applied, disconnect the external USB drive and restart the PC by typing exit. After the PC reboots, if the Start screen appears, then you have correctly configured the settings to boot to audit mode.

Note

Troubleshooting: If the PC boots and OOBE starts, Windows is not in audit mode. Check the answer file to make sure that the Microsoft-Windows-Deployment\Reseal setting is set to Audit.

Open the Desktop. If the System Preparation Tool (Sysprep) window is open, close it.

In File Explorer, right-click This PC and then click Properties.

If the System application from Control Panel appears and displays your manufacturer support information, you have correctly configured the settings that provide support information.

From the Desktop, click the Internet Explorer icon in the taskbar. If your company web site appears, you have correctly configured the Internet Explorer settings.

Note

Windows Store apps, Internet Explorer and PC settings do not work in audit mode. Use Internet Explorer for the desktop and the desktop Control Panel settings instead.

To check to see if your sample script ran, you'll need to set the PC to boot to OOBE, then complete OOBE like an end user. After that, you can check to see if the file: C:\Fabrikam\DxDiag-TestLogFiles.txt exists.