How to Add Device Drivers by Using Windows Setup
Published: February 29, 2012
Updated: May 31, 2012
Applies To: Windows 8, Windows Server 2008 R2, Windows Server 2012
To install Windows® on some hardware designs, you may need to add device drivers to Windows Setup. You can add drivers to Windows Setup by using an answer file that specifies the path to the driver files. To do this in new installations, you add the Microsoft-Windows-PnpCustomizationWinPE component during the windowsPE configuration pass, add the driver paths, and then specify the answer file.
You can also modify existing images and add and remove drivers. You can service offline images in several ways. For example, you can add the Microsoft-Windows-PnpCustomizationsNonWinPE component during the offlineServicing configuration pass, add or remove the driver paths, and then specify the name of the answer file. For more information about how to modify drivers on an offline Windows image by using an answer file, and also other methods of adding drivers to and removing drivers from an existing image, see How to Add and Remove Drivers Offline.
For new installations, you add drivers during the windowsPE configuration pass.
This method initializes Windows Preinstallation Environment (Windows PE) and processes Windows PE settings from the answer file, as follows:
Windows stages the Windows PE drivers in the RAM driver store.. Windows loads boot-critical drivers that Windows PE requires to access the local disk and network. When you right-click DevicePaths and select Insert New PathAndCredentials into Windows PE, Windows PE processes other Windows PE customizations that the answer file specifies.
The Windows Setup process applies the Windows image. Boot-critical drivers appear on the Windows image before Setup installs that image. Other drivers that you added to the Windows PE driver store appear in the Windows image driver store. When Windows Setup processes the offlineServicing pass, Windows Setup also adds any drivers that the driver path specifies to the Windows image driver store.
Use Windows System Image Manager (Windows SIM) to create an answer file that contains the paths to the device drivers that you intend to install.
Add the Microsoft-Windows-PnpCustomizationsWinPE component to your answer file in the windowsPE configuration pass.
Expand the Microsoft-Windows-PnpCustomizationsWinPE node in the answer file. Right-click DevicePaths, and then select Insert New PathAndCredentials.
A new PathAndCredentials list item appears.
For each location that you access, add a separate PathAndCredentials list item.
You can include multiple device driver paths by adding multiple PathAndCredentials list items. If you add multiple list items, you must increment the
Keyvalue for each path. For example, if you add two separate driver paths, the first path uses the
1, and the second path uses the
Save the answer file, and then close Windows SIM. The answer file must resemble the following example:
<?xml version="1.0" encoding="utf-8" ?> <unattend xmlns="urn:schemas-microsoft-com:unattend"> <settings pass="windowsPE"> <component name="Microsoft-Windows-PnpCustomizationsWinPE" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <DriverPaths> <PathAndCredentials wcm:keyValue="1" wcm:action="add"> <Credentials> <Domain>Fabrikam</Domain> <Password>MyPassword</Password> <Username>MyUserName</Username> </Credentials> <Path>\\server\share\drivers</Path> </PathAndCredentials> </DriverPaths> </component> </settings> </unattend>
Boot to Windows PE.
At a command prompt, run Windows Setup. Specify the name of the answer file. For example:
Windows Setup adds the device drivers in the \\server\share\drivers path to the system during the setup process.
For more information about drivers, see Device Drivers and Deployment Overview and How to Add a Driver Online in Audit Mode. For more information about Windows components, see Unattended Windows Setup Reference.