Below is a procedure to allow you to automate the installation of drivers during Windows setup. I show how to export and then subsequently install ALL system drivers, but you can also use this to install individual drivers. Those drivers just need to be extracted with the .INF file available. No image files (.CAB, .ZIP, .ISO, etc.) can be used.
Overview
You can create a folder named $OEM$ with a specific structure. Inside of this structure you will place a script and all of the drivers for your system. Files in this folder will automatically get copied to your Windows installation during setup and the script will be executed. We will use the script to install all drivers. Note that no answer file is needed - this will work even with a manual setup of Windows. However, if you do use an answer file, this will still work fine along with the answer file and no changes need to be made to the answer file.
Likewise, we can use a folder named $WinPeDriver$ and drop that onto the UFD (USB Flash Drive) to automatically load boot critical drivers. Again, no answer file is needed, but you can use one if you wish with no modifications, and this will work with a manual installation of Windows.
Preparation
Create your bootable Windows disk. Use whatever your normal method is to create a Windows UFD.
From the ZIP file included in this post, extract the $OEM$ folder and drop it into the \Sources folder. If you use a dual partition UFD (a small FAT32 partition and a larger NTFS partition for installing Windows), then drop this folder into \sources on the 2nd (NTFS) partition.
You will note that in the #OEM$\$$\Setup\Scripts folder you will find a file named SetupComplete.cmd. This is the script that installs the drivers. Feel free to examine or modify this script to suit your needs.
While your system is still working (prior to starting a clean installation of Windows), we should export all the drivers so that we can drop them into this $OEM$ folder.
NOTE: If you only want to install one or two drivers, you can do this. In this procedure I show you how to install ALL system drivers, but nothing says you have to do this. You can install only those drivers that you want.
Optional - Delete Old Drivers from The System
Before we export drivers, you may want to clean out all your old, unused drivers.
As new drivers are installed onto Windows, the driver store becomes larger and larger because the old drivers are not cleaned up. If you wish to perform a cleanup, do this:
Download Driver Store Explorer (RAPR) and run it. You can download Driver Store Explorer (RAPR) from here:
Driver Store Explorer. Contribute to lostindark/DriverStoreExplorer development by creating an account on GitHub.
github.com
Choose to export all drivers.
Chose the option to select old drivers and once selected choose to delete those drivers.
NOTE: The only reason that I ask you to export the drivers first was just in case any problem is caused by deleting unused drivers. I have never seen that cause a problem, but I'm not taking a chance with someone else's system

.
Exit Driver Store Explorer.
END OF OPTIONAL PROCEDURE
EXPORT DRIVERS - METHOD 1
Open Driver Store Explorer and choose the option to export all drivers.
Exit Driver Store Explorer.
END METHOD 1
EXPORT DRIVERS - METHOD 2
This method uses Windows command line to export the drivers.
Open a command prompt and run these commands:
md c:\drivers
pnputil /export-driver * c:\drivers
NOTE: For both commands, you can use any folder in place of C:\drivers. Just make sure to specify the same folder for both commands.
END METHOD 2
Copy (or move) the contents of the folder to which you saved the drivers to \sources\$OEM$\$1\drivers. After doing this, you can delete the folder to which you originally saved the drivers.
Handling Boot Critical Drivers
Boot Critical drivers are drivers that are necessary for Windows Setup to function. For example, if you have a RAID controller for which Windows has no driver, a driver will need to be loaded to allow Windows Setup to see the drives attached to that controller. The Intel IRST driver is a prime candidate for this. Likewise, many laptops require a driver to be loaded in order for the touchpad or touchscreen to function. For touchpads and touchscreens, it is often necessary to load an I2C and/or GPIO driver.
Create a folder on the root of your UFD named $WinPEDriver$.
NOTE: If you are using a dual partition UFD with a small FAT32 partition and a larger NTFS partition for installing Windows, you can drop this folder onto either partition. My preference is to drop it on the second partition since it has more room. Inside this folder, drop your Boot Critical driver(s). Each driver should be in its own folder and the drivers should be extracted with a .INF file available. These drivers will automatically be loaded by Windows Setup.
END PROCEDURE
If you need any clarification on how this works or you just have any questions, please do let me know.