Tobias Erdle's Blog

Development Engineer working with different technologies. Former Jakarta MVC & Eclipse Krazo Committer. All views are my own.

Github: erdlet | E-Mail: blog (at) erdlet (punkt) de

Export and import Windows third party drivers on command line

TL;DR

To export and import third party drivers between two Windows installations you can use pnputil.exe.

What is the challenge?

I have to maintain an Windows image that is rolled out on different hardware devices after doing a sysprep. Until now, there were only two devices and I created separate images with manually installed third party drivers. But in the future there are more devices to support and I had to find a solution to export drivers from a reference device and import them into a virtual machine that is used as base for a single general image.

How did I solve this challenge?

After doing some research I read about the Windows tool pnputil which is able to handle 3rd party drivers. With this tool I was able to export all third party drivers, for example the Intel Chipset driver, by using the command pnputil /export-driver * C:\Temp_Drivers (NOTE: the path C:\Temp_Drivers must exist and can be named like whatever you want). To import those drivers on the target machine, I used pnputil /add-driver C:\Temp_Drivers\*.inf /subdirs. Please ensure to use the /subdirs flag, so the tool looks recursively into the subdirectories. After the import is done, Windows contains those drivers in its storage and after e. g. a sysprep the correct drivers are used by the hardware devices.