I’m a big fan of dpinst as well. Injecting for reals, into an OS for 30 different platforms prior to sysprep bloats the registry and can even poison an image in extreme cases.
I prefer to not leave Windows to install drivers as it wants, but where I want, when I want; I do this in the unattend.xml.
<settings pass="specialize">
<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ExtendOSPartition>
<Extend>true</Extend>
</ExtendOSPartition>
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Description>Driver Installation Pass 1 of 3</Description>
<Path>"C:\temp\drivers\dpinst.exe" /path "C:\temp\drivers" /q /se</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>2</Order>
<Description>Driver Installation Pass 2 of 3</Description>
<Path>"C:\temp\drivers\dpinst.exe" /path "C:\temp\drivers" /q /se</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>3</Order>
<Description>Driver Installation Pass 3 of 3</Description>
<Path>"C:\temp\drivers\dpinst.exe" /path "C:\temp\drivers" /q /se</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
</settings>
Where C:\temp\drivers\ contains every driver extracted from every system needed.
Alongside dpinst.exe in c:\temp\drivers I also place the dpinst.xml
<?xml version="1.0" ?>
<dpinst>
<!-- equivalent to /sa -->
<suppressAddRemovePrograms/>
<!-- The following search and subDirectory elements direct DPInst to search all subdirectories (under the DPInst working directory) to locate driver packages. -->
<search>
<subDirectory>*</subDirectory>
</search>
<!-- The following language element localizes its child elements for the English (Standard) language. The child elements customize the text that appears on the DPInst wizard pages. -->
<language code="0x0409">
<dpinstTitle>Device Driver Updater</dpinstTitle>
<welcomeTitle>Welcome to the Device Installer!</welcomeTitle>
<welcomeIntro>This wizard will walk you through updating the drivers for your device.</welcomeIntro>
<installHeaderTitle>Installing the software for your device...</installHeaderTitle>
<finishTitle>Congratulations! You finished installing your device drivers.</finishTitle>
</language>
<!-- equivalent to /sh -->
<scanHardware/>
</dpinst>
I run dpinst three times deliberately. First to grab primary devices, then to detect and load daughter devices, and then finally for those very few tertiary devices that can only be seen after two other parent devices are loaded.
I then leave it to setupcomplete.cmd to reclaim the disk space taken up by staging the drivers in the image.
@REM Place this file in C:\Windows\Setup\Scripts
@REM SetupComplete.cmd is executed as final step of coming out of Sysprep under SYSTEM account
@REM Cleanup
del /Q /F c:\windows\system32\sysprep\closer*.xml
del /Q /F c:\windows\system32\sysprep\default*.xml
del /Q /F c:\windows\panther\unattend.xml
rd /s /q C:\temp
rd /s /q C:\temp
This does not take care of any OEM software which I install through separate automated means.
My current driver pack for Windows 10 (64) is fully compatible with 30 different makes/models in our environment.
Manufacturer Model Name Model Version
Dell Inc. Latitude 3379 <blank>
Dell Inc. OptiPlex 790 <blank>
Dell Inc. OptiPlex 7010 <blank>
Dell Inc. OptiPlex 7020 <blank>
Dell Inc. XPS One 2710 <blank>
LENOVO 7373BTU ThinkCentre M58
LENOVO 3548C1U ThinkCentre M72z
LENOVO 3548C8U ThinkCentre M72z
LENOVO 10BBS00Y00 ThinkCentre M73z
LENOVO 10BBS12Q00 ThinkCentre M73z
LENOVO 10EWS0B000 ThinkCentre M800z
LENOVO 10NY0010US ThinkCentre M810z
LENOVO 20GKS0A700 ThinkPad 13
LENOVO 20J2S0MJ00 ThinkPad 13 2nd Gen
LENOVO 20FES0VJ00 ThinkPad Yoga 260
LENOVO 20JJS2F200 ThinkPad Yoga 370
LENOVO 30ASS3NA0 ThinkStation P310
LENOVO 30BH002KUS ThinkStation P320
Toshiba PORTEGE R830 PT320C-0F502L
Toshiba PORTEGE R830 PT320C-01H018
Toshiba PORTEGE R830 PT320C-05L02L
Toshiba PORTEGE R930 PT330C-00v009
Toshiba PORTEGE R930 PT330C-05X039
Toshiba PORTEGE R930 PT330C-08S039
Toshiba PORTEGE Z930 PT235C-02H049
Toshiba PORTEGE R30-A PT341C-00W00T
Toshiba PORTEGE R30-A PT343C-0YP08W
Toshiba PORTEGE R30-A PT343C-01N01J
Toshiba PORTEGE Z30t-A PT24CC-05D02V
Toshiba TECRA R700 PT318C-00C001