Injecting Drivers Based On Target Computer Model Using MDT

One of the first thing I learnt when I started getting into Windows deployment was that Microsoft and, more importantly, the industry in general encourages the development of one master image and using a tool such as the Microsoft Deployment Toolkit to inject the right drivers based on the computer model at deploy time. I was curious to see how it works in practice since my workplace had a different image for every computer model within the organisation.

There are two ways to get this done – using Selection Profiles and using a custom Task Sequence Variable. I chose the latter which I understand is the right way to go about it.

In a nutshell, the custom Task Sequence Variable step runs a WMIC query to determine the make and model of the target computer at deploy time and look for drivers in the right subdirectory within the Out-Of-Box Drivers folder. It’s important that the names of the subdirectories must be exactly the same as the make and model returned from the WMIC query.

Here’s how this is set up in my Lab which will work for both MDT 2010 and MDT 2012.

The Out-of-Box Drivers Folder

First things first, here’s how my Out-of-Box Drivers folder is organised within the Deployment Workbench


You will notice that I’ve organised my folders by Windows version and architecture, followed by make and model. You must run a WMIC query on your target computer to determine the make and model of the computer and make sure you spell the make and model exactly the same in your Out-of-Box Drivers subdirectories as the values returned from the query.

The folder name for the computer manufacturer (e.g. Windows 7 x64\Hewlett-Packard) must match the value returned from running a WMIC query on the target computer

WMIC csproduct GET vendor


Similarly, the computer model (e.g. Windows 7 x64\Hewlett-Packard\HP Compaq dc5800 Small Form Factor) must match the value returned from the query too

WMIC csproduct GET name


The Delploy Task Sequence

On my deploy Task Sequence I added a custom Task Sequence Variable above the Inject Drivers step in the Preinstall stage as follows:


The important thing to notice here is the value field.

The %make% and %model% variables will be determined at deploy time when a WMIC query is run to determine the manufacturer and model of the target computer. It is for this reason the folder names in the Out-of-Box Drivers folders must match the value returned from the WMIC query on your target computer otherwise injecting the drivers will fail.

Finally, in the Inject Drivers step just below our custom Drivers Path step we created earlier, select “Nothing” under “Choose a selection profile”.


That’s it. As long as you get the computer manufacturer and model exactly right everything should work perfectly.


19 thoughts on “Injecting Drivers Based On Target Computer Model Using MDT

  1. Thank you for the article. I definitely want to figure out how to get this working.

    I did want to point out that your command is incorrect in the article, however the screenshot does show you using the right one:

    “WMIC csproduct GET model” should be “WMIC csproduct GET name”

    Take care!

  2. Thanks for great article. Just wondering – do I need to set up Inject drivers profile selection also in Postinstall TS or default Inject Drivers from Command line (cscript.exe “%SCRIPTROOT%\ZTIdrivers.wsf”) is enough? Thanks

  3. I have Dell tablet Venue 10 pro 5055, I’m trying to pxe boot to it with an ethernet usb adapter from startech. I”m able to pxe boot but when I have to type the credentials to pick the task sequences it shows me that Invalid credentials: The network path was not found. I use the same method on a regular PC my credentials work just fine there. I’m wondering what needs to be done in order for me to be able to authenticate from the tablet. By the way the ethenet usb adapter drivers I have injected in Out-of-Box. Please help, I would appreciate your help.

  4. Do I need to worry too much about WinPE drivers added to MDT if I’m running a new deployement from within the OS and not using WDS to pxe boot?
    I have just left the Windows PE settings alone under my Deployment Share.
    I’m deploying my custom Windows 10 image x64, the settings I have are below

  5. As a complete MDT newbie. There are some steps missing I couldn’t figure out right now. Where do you get the content for the variables and where do you select the matching folder to copy the drivers?

    • All drivers are stored in Out Of Box Drivers in MDT, add them there in folders and subfolders based on the results from the commands above

  6. Can I use %vendor% somehow instead of %make%? It would make my setup alot cleaner, easier and more pro looking

    • I don’t think %vendor% is a built in variable. If you really wanted to use that variable then you’ll have to create it using a “Set Task Sequence Variable” step by assigning the value of %make% to Vendor. You’ll need to make sure this step is run after the initial Gather step (which is when the variables are created).

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s