Add a Driver Online in Audit Mode
Published: October 22, 2009
Updated: January 5, 2012
Applies To: Windows 7, Windows Server 2008 R2
|This content applies to Windows 7. For Windows 8 content, see Windows Deployment with the Windows ADK.|
You can use an answer file to automate the installation of device drivers when the computer is booted in audit mode.
Adding a Device Driver
The auditSystem configuration pass processes unattended Setup settings while Windows® is running in system context, before a user logs on to the computer in audit mode. The auditSystem configuration pass runs only if the computer is booted in audit mode. To add device drivers during the auditSystem configuration pass, add the Microsoft-Windows-PnpCustomizationsNonWinPE component to your answer file in the auditSystem configuration pass, and specify the path for each device driver. After you run Setup, boot Windows to audit mode. You can run the Sysprep command with the /audit option to configure the computer to start in audit mode the next time that it boots. Or, in the answer file, you can configure the Microsoft-Windows-Deployment\Reseal\Mode setting to audit. For more information about this setting, see the Windows® Unattended Setup Reference.
To add a device driver during the auditSystem configuration pass
Locate the.inf files that you want to install during audit mode for the device driver.
Open Windows System Image Manager (Windows SIM). Click Start, point to Programs, point to Microsoft Windows OPK (or Windows AIK), and then click Windows System Image Manager.
Open your answer file and expand the Components node to display available settings.
Add the Microsoft-Windows-PnpCustomizationsNonWinPE component to your answer file in the auditSystem configuration pass.
Expand the Microsoft-Windows-PnpCustomizationsNonWinPE node in the answer file. Right-click DevicePaths, and then click Insert New PathAndCredentials.
A new PathAndCredentials list item appears.
For each location that you access, add a separate PathAndCredentials list item.
In the Microsoft-Windows-PnpCustomizationsNonWinPE component, specify the path of the device driver and the credentials that are used to access the file if the file is on a network share.
Note You can include multiple device-driver paths by adding multiple PathAndCredentials list items. If you add multiple list items, you must increment the value of
Keyfor each path. For example, if you add two separate driver paths, the first path uses the
Keyvalue of 1, and the second path uses the
Keyvalue of 2.
Save the answer file and close Windows SIM. The answer file must resemble this example:
<?xml version="1.0" encoding="utf-8" ?> <unattend xmlns="urn:schemas-microsoft-com:unattend"> <settings pass="auditSystem"> <component name="Microsoft-Windows-PnpCustomizationsNonWinPE" 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>\\networkshare\share\drivers</Path> </PathAndCredentials> </DriverPaths> </component> </settings> </unattend>
Boot in Windows Preinstallation Environment (Windows PE), run Windows Setup, and specify the name of the answer file. For example:
Run the Sysprep command with the /audit option to configure the computer to start in audit mode the next time that it boots. For example:
sysprep /audit /reboot
You can use the PNPUtil tool to add, remove, and enumerate drivers on a running operating system. For more information about how to use PNPUtil to add or remove Plug and Play drivers, see Install a Plug and Play Device.