Inspired by Michael's blog post on grabbing drivers from running computer from here: http://blogs.technet.com/b/mniehaus/archive/2013/09/16/grabbing-out-of-box-drivers-from-a-windows-8-system.aspx, since I've always been advocating the dynamic approach to drivers management, I decided to address some of his concerns and developed my own "drivers harvester". There is a bunch of tools out there, but I would not recommend using them - for example, one of them copies file from INF file keeping its name of OEM<number>.inf. But that, actually, gave me an idea how to tell OEM from inbox drivers..
So let me answer Michael's caveats:
Answering this, we're not trying to address things like Bluetooth stacks, or Wireless bundles of software - the task is limited to anything that can be installed either with "Install Drivers from Package" or "Auto Apply Drivers" in SCCM or Apply Drivers in SCCM. There is always will be that subset of "tools" that OEMs want to call "Drivers" when actually they are not drivers that you can install with INF. We will have to deal with them separately. My point is that if it's not a software bundle, everything you need is under C:\Windows\System32\DriverStore\FileRepository.
This is a real concern. So what I do in my harvester, I only find drivers that are currently loaded with psapi.dll library method called EnumDeviceDrivers http://msdn.microsoft.com/en-us/library/windows/desktop/ms682617(v=vs.85).aspx
This is, again, a valid concern, but since we're only checking loaded drivers, we are skipping older versions automatically.
And here is what Michael says: "For example, my laptop has over 100 out-of-box drivers. Does it really need 100 drivers to work? No, it only needs 6-7."
You got it, Michael. Sorry, it's a little more - but all of those are a real deal!
So here is the algorithm - how it works.
Here is how to use it:
Enjoy! If you don't trust unknown exe from untrusted source - source code is attached.