Fantastic response,
@garlin!
Below is the recipe that I use for installing both boot critical and main system drivers. These are simply my notes to myself so that I can easily do this anytime, but I mostly have this automated now. There is some other info in here as well, but you can simply gloss over the parts not of interest to you. Note too that while a lot here is geared toward unattended install, you can still use both or either $WinPeDriver$ / $OEM$ in a fully manual installation as well. Put another way, you don't need to be doing unattended installation for these to work.
I install Windows multiple times every single day and this method works for me every single time.
There are several ways to install Windows, including multiple variations on installing Windows unattended. In this document I present a procedure that will do the following:
- Install Windows 100% unattended. Boot from a flash drive, walk away a while, when you come back Windows will have been fully installed including all drivers.
- Will format and partition the drive to which Windows is to be installed "the right way".
- Includes any boot critical drivers
- Includes all drivers for the system being installed onto
- Bypasses Win 11 requirements for use with systems that do not meet Win 11 requirements
- Prevents quality updates during setup
- Creates a clean Start screen without all the typical bloat
- Setup WiFi networking
- Configure Remote Desktop so that the system can be configured remotely right after setup
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 although no changes need to be made to the answer file.
Likewise, we can use a folder named $WinPeDriver$ and drop that onto the UFD 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. DO NOT include an autounattend.xml answer file yet since we will boot from this disk and do not want it to start installing Windows yet.
NOTE: If you are undecided on the method to use to create your UFD, I would like to suggest using the utility that I have included here. Use the directions in the section below called "creating UFD with app".
After making your UFD, boot from that it. At the first static screen, press SHIFT + F10 to open a command prompt. From the command prompt, run Diskpart to determine the ID of the disk to which Windows will be installed. Make a note of that ID. Why are we doing this? When booted from your Windows installation media, the disk IDs may be different than they are in a running installation of Windows. We need to be sure to have the correct disk ID as seen by Windows Setup.
IMPORTANT: It is imperative that you obtain the correct disk ID since the ID that you will specify in the steps below will be used to wipe that disk in preparation for the installation of Windows.
Create a folder named $OEM$ and place it on your UFD in 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. Create a subfolder structure like this:
Within the $OEM$ folder, create two folders named $$ and $1. Within $$ create a folder named Setup, and within Setup create a folder named Scripts. Within the $1 folder create a folder named "Drivers" and another named "WiFi Profile".
The end result should look like this:
$OEM$
+---$$
| \---Setup
| \---Scripts
\---$1
\---Drivers
\---WiFi Profile
In the Scripts folder, create a text file with the contents shown below and name it setupcomplete.cmd.
REM START OF SETUPCOMPLETE.CMD
REM ********************************
REM * Last updated on Nov 21, 2025 *
REM ********************************
@echo off
pushd C:\Drivers
REM *****************************************************************
REM * The Intel Chipset driver should be installed FIRST so we will *
REM * run the setup for it before installing the other drivers on *
REM * systems for which we have this driver. Otherwise, comment out *
REM * that line. *
REM *****************************************************************
REM SetupChipset.exe -s
REM ***************************************************
REM * The lines below install all other drivers aside *
REM * from the chipset driver installed above. *
REM ***************************************************
pnputil /add-driver C:\Drivers\*.inf /subdirs /install
popd
REM ***************************************************************
REM * Install the WiFi profile from the "C:\WiFi Profile" folder. *
REM ***************************************************************
netsh wlan add profile filename="C:\WiFi Profile\Wi-Fi-proper-eero.xml" user=all
REM ***********************************************
REM * Remove the drivers and WiFi profile folders *
REM ***********************************************
RD "C:\Drivers" /S /Q
RD "C:\WiFi Profile" /S /Q
REM ***********************************************************************
REM * Delete this batch file and the scripts folder from where it is run. *
REM ***********************************************************************
del %0 & RD "C:\Windows\Setup\Scripts" /S /Q
REM END OF SETUPCOMPLETE.CMD
While your system is still working (prior to starting a clean installation of Windows), we should export all the drivers so that we can later re-import them into our new installation.
OPTIONAL (STRONGLY RECOMMENDED)
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. Chose the option to select old drivers and then delete drivers. Exit Driver Store Explorer.
END OPTIONAL STEP
Export all of your drivers by running the two commands below from a command prompt:
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.
Copy (or move) the contents of c:\drivers to \sources\$OEM$\$1\drivers. After doing this, you can delete C:\drivers (or whatever location you used).
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. Likewise, many laptops require a driver to be loaded i 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 it's own folder and the drivers should be extracted with a .INF file available. These drivers will automatically be loaded by Windows Setup.
Setting Up WiFi
To make WiFi available right after setup, we can load a network profile from the SetupComplete.cmd. This profile is stored in a single .XML file. You will need to create this profile from a machine that is on the WiFi network that you wish to use. Note that if you already have a running copy of Windows on the machine that you will be performing the clean install on then you can use this machine while it still has Windows on it.
IMPORTANT: I strongly suggest doing this from the same machine that you will be installing Windows on or at least a machine with the same WiFi adapter. The first time I tried this, I exported the profile from a machine with a WiFi 7 adapter and tried to use it on a machine with a WiFi 5 adapter only to discover that the WiFi 5 adapter did not support WPA3 as the WiFi 7 adapter does. This caused WiFi to not work after setup on that system.
To create this network profile make a temporary folder to save it in. In this example I will assume "C:\WiFi Profile". Now run this command:
netsh wlan export profile name="YourSSID" folder="C:\WiFi Profile"
Now, just copy or move the file created in "C:\WiFi Profile" to the "WiFi Profile" folder that you created within the $OEM$ folder.