One annoying thing in the newer version of Windows, to me, is the DriverStore. Not only does it make it more difficult than it should be to add tons of drivers in one shot, but to me, it’s just not that intuitive of a way to manage them. Espicially when I’m trying to add drivers for like 9 different models of equipment to a generic image! Well, luckily, scripting once again comes to the rescue! Here’s a little one I got done today that lets you throw all drivers into the store in one shot!
First, put all your drivers into one folder. Call it like, C:\Drivers or what have you. You can have other folders inside this, but make sure everything you’re wanting to add is in one place, for easy to use. Next, fire up an admin cmd prompt or powershell instance. It has to be an admin one, else it won’t have access to add things to the DriverStore, cuz reasons.
In that command prompt, hit the following command:
forfiles /p C:\Drivers /s /m *inf /c "cmd /c pnputil -a @path"
All that’s gonna do is use the ForFiles command , which using it’s /p flag will search in that folder, and the /s flag tells it to recurse. the /m tag tells it what we’re looking for, which in this case is any .inf file. It then will run a command via the /c tag, in this case the pnputil, telling it to -a or add the file it found at the path @path we’re currently using.
Boom! All drivers in the driver store! Golden images again!