Where does windows installation search for drivers to install?

Marco Tommaso 0 Reputation points
2025-03-01T09:03:51.51+00:00

Hello, I often deploy custom windows 10 and 11 images using WDS, but I'm not able to understand where the installation process looks for driver to install during the installation. I know after the installation and the first boot, windows looks for .inf files in c:\windows\inf , but it seems not to be the same during the installation process. I tried to mount boot.wim with dism and add .inf files in the c:\windows\inf folder of the mounted image, but drivers still won't install. I don't want to include drivers in install.wim or boot.wim by installing them with dism /add-driver option, because I need only one installation image with multiple hardware drivers and they conflict with each other. I can't even add drivers to WDS because they're unsigned, my WDS server is 2008 R2 (and images I'm deploying are windows 11 24h2). Is there a way to put .inf files somewhere in the boot.wim and let windows choose for the proper driver to install during the installation process?

Windows Server Devices and deployment Set up, install, or upgrade
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Marcin Policht 38,155 Reputation points MVP
    2025-03-01T11:14:01.1433333+00:00

    During the Windows installation process, drivers are typically loaded from a few key locations, but the behavior differs from post-installation driver loading. If you are deploying Windows 10 and 11 images using Windows Deployment Services (WDS) on Server 2008 R2, you cannot integrate unsigned drivers into WDS.

    Let's start with addressing your question about where Windows looks for drivers during installation

    1. boot.wim (WinPE Phase)
      • Windows loads drivers during the WinPE phase of installation from boot.wim. However, just placing .inf files in C:\Windows\INF in the mounted boot.wim won’t work because drivers are not automatically detected from that location.
      • Instead, drivers should be in specific locations where Windows searches for them, such as:
        • X:\Windows\System32\DriverStore\FileRepository
        • X:\Windows\inf
        • X:\Windows\System32\drivers
    2. install.wim (Specialized Phase)
      • After copying files from install.wim, Windows looks for drivers in:
        • %WINDIR%\inf
        • %WINDIR%\System32\DriverStore\FileRepository
        • The driver path specified in unattend.xml (if used)
      • Since your goal is not to integrate drivers directly into install.wim, an alternative method is needed.

    If you are looking for alternative methods to provide drivers without integration, then try the following:

    1. Using $WinPEDriver$ Folder on Installation Media Windows Setup can scan for drivers placed in a special directory on the installation media. You can try placing your .inf files in:

    X:\$WinPEDriver$\
    

    or on a secondary USB drive at:

    <USB-ROOT>\$WinPEDriver$\
    

    Windows automatically looks in this directory for drivers during setup.

    2. Manually Adding Drivers in WinPE (Before Setup Starts) If $WinPEDriver$ does not work, another way is to inject drivers dynamically at runtime using pnputil or drvload. You can modify winpeshl.ini or a startup script inside boot.wim to load drivers before setup starts:

    1. Modify winpeshl.ini (inside boot.wim)
      • Mount boot.wim using DISM:
             dism /mount-wim /wimfile:"D:\sources\boot.wim" /index:1 /mountdir:"D:\mount"
        
      • Create a script in D:\mount\Windows\System32\Startnet.cmd or modify winpeshl.ini to run:
             drvload X:\Drivers\yourdriver.inf
        
      • Unmount and commit:
             dism /unmount-wim /mountdir:"D:\mount" /commit
        
    2. Use a Custom cmd Script to Add Drivers Dynamically
      • Store all .inf files in X:\Drivers\
      • Add a script to run:
             for /r X:\Drivers %i in (*.inf) do drvload %i
        
      • This forces Windows to load all available drivers dynamically before the installation begins.

    3. Using unattend.xml to Specify a Driver Path If you use an unattended installation, you can specify an additional driver search path:

    <settings pass="windowsPE">
        <component name="Microsoft-Windows-PnpCustomizationsWinPE">
            <DriverPaths>
                <PathAndCredentials wcm:action="add">
                    <Path>X:\Drivers</Path>
                </PathAndCredentials>
            </DriverPaths>
        </component>
    </settings>
    

    Place the drivers inside X:\Drivers, and Windows Setup will scan this location.


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.