W10 1809 Drivers and DriverStore\FileRepository

Clanger

Moderator
Staff member
Can i change the location of the contents of System32\DriverStore\FileRepository so that only drivers needed get added to System32\DriverStore\FileRepository and then i can delete the custom folder? For instance they get put in the same location setupcomplete puts files which would be deleted anyway? On a dvd/blu-ray drive(E: )maybe?

Captured wim, winsxs cleaned out down to 40odd mb, all drivers kept and backed up during capture.
I want to keep 2 custom captured discs only, 1 a default and 1 lited.
 
Last edited:
Making sure I understood the question.
You would like to change the location of installed drivers, but separate the built-in ones that were not used?
Huh... that's quite specific, I don't know if possible, guess is no.

What you could do is run NTLite on the target machine, and load any image.
Go to drivers and from the toolbar choose Host Import, that will import all the installed, 3rd party drivers.
If that matters in any way to this question.

Other than that, logs, registry, INFs, investigation... I'm guessing you want to remove non-used drivers or what's the goal?
 
For my hardware combinations i only need w10s built in drivers, i dont need to add any.
I dont want to make a certain hardware specific image, 1 image to do them all.
Move all the driver files to x:\sources\$OEM$\$$\Setup\Files.
I am thinking(hoping) that during Setup windows will search everywhere for availible drivers, not just in System32\DriverStore\FileRepository so it will find the required drivers in C:\Windows\Setup\Files and just add those to FileRepository.
C:\Windows\Setup\Files will be deleted by an NTLite generated setupcomplete.cmd or i can delete that folder later on manually.
The full complete FileRepository can be kept on dvd/blu-ray drive or as an iso and any driver i need later on can be added by search or have disk.

Or, if its actually possible, keep the drivers outside of a wim and just have them on the install media.

The 2 biggest space hogs are winsxs and file repository so if i can get rid of them, uneeded kb's languages and fonts i can get a slimmed down os but with all the major components intact.
 
Last edited:
Ive seen(but not gone into) pnpunattend before and i thought it was mainly for drivers that are not included in the os image.
What would windows setup do if there we no drivers availible in the image itself, would it search everywhere, if not how would i force pnpunattend during setup, would i need to add the comand line code to a setupcomplete.cmd file?
 
Windows Setup only searches for registered INF files inside DriverStore. Nowhere else. You don't want a rootkit issue by allowing drivers from a random folder, it must be a trusted application (pnputil/dpinst) to load them.

The exception being pnpunattend, which is hands free. But it doesn't take any command line option for search paths.
You can create multiple subkeys, starting from DriverPaths\1, each with a different folder location.

It's a little hard to point back to the DVD/USB volume, since you can't guarantee the drive letter. Well, you'd have to write a PS script...

Copy the three steps into a single batch file, then drop it in SetupComplete. Easier for editing.
You can test the script on a live system, before committing it to NTLite.
 
Windows Setup only searches for registered INF files inside DriverStore.
Thats what i feared :( .

The exception being pnpunattend, which is hands free. But it doesn't take any command line option for search paths.
You can create multiple subkeys, starting from DriverPaths\1, each with a different folder location.
Ie "REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\UnattendSettings\PnPUnattend\DriverPaths\1" /v Path /t REG_SZ /d "C:\Drivers" ?

It's a little hard to point back to the DVD/USB volume, since you can't guarantee the drive letter.
I can guarantee drive letters, im using an internal optical drive. C:, D: = usb install media, E: = optical drive. I can write different locations using DriverPaths\x for any possible variations if needed.

Copy the three steps into a single batch file, then drop it in SetupComplete. Easier for editing.
Gotcha :).

Ive learned hard lessons from defender on w10, it cant delete files it dont like on dvd. Ive never ditched dvd/blu-ray format.
 
Last edited:
Works fine from a live system.

C:\Windows\system32>mkdir C:\Drivers

C:\Windows\system32>reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\UnattendSettings\PnPUnattend\DriverPaths\1" /v Path /t REG_SZ /d "C:\Drivers"
The operation completed successfully.

C:\Windows\system32>pnpunattend auditsystem /s /l
INFO: AuditSystem
INFO: Will only search for drivers. No install will be done.
INFO: Found key '1'
INFO: Processing '1'...
INFO: Path = 'C:\Drivers'
WARNING:No credentials provided

INFO: Searching for drivers at 'C:\Drivers'...
WARNING:No driver packages found at 'C:\Drivers'
INFO: No drivers installed.
EDIT - "No credentials provided" means you didn't use a domain user/password.
 
Last edited:
Reading the MS docs, WinPE can search other paths if properly configured.
No scripting work, but careful copy/pasting. Credentials only required for \\server\path network folders.

Copy this XML into your NTLite preset.
Code:
        <component name="Microsoft-Windows-PnpCustomizationsWinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
            xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <DriverPaths>
                <PathAndCredentials wcm:keyValue="1" wcm:action="add">
                    <Path>D:\folder1</Path>
                </PathAndCredentials>
                <PathAndCredentials wcm:keyValue="2" wcm:action="add">
                    <Path>E:\folder2</Path>
                </PathAndCredentials>
            </DriverPaths>
        </component>

Inside NTLite's unattended block:
Code:
    <settings pass="windowsPE">
        <component name="">
        </component>
        <component name="">
        </component>
        <component name="Microsoft-Windows-PnpCustomizationsWinPE"
        </component>
    </settings>

Long form example:
https://gist.github.com/oldpatricka/3fa1095ce25c766368b8dde43286c0d7
 
Forum wont let me post, says "oops we ran into a problem"no s--t sherlock. arghhhhhhhhhhhh.
Sorry about this but i dont know xml, its too damn fkkn complicated for its own damn good. arghhhhh

This is line 84 and onwards with both blocks added.
 

Attachments

  • New Text Document (2).txt
    2.1 KB
These four?
Code:
    </settings>
        <settings pass="windowsPE">
        <component name="Microsoft-Windows-PnpCustomizationsWinPE"
        </component>
    </settings>
Done.
 
Your XML app will recognize it as correct by looking at the left margin [+] numbering.
If we're done cleaning up the XML, let me know and we can both clean up this thread :rolleyes:
 
garlin Thank you for your time, your help and your patience, Thank you :)

If we're done cleaning up the XML, let me know and we can both clean up this thread :rolleyes:
Keep this thread exactly as it is.
1 its mine, i only like to cleanup on other peoples threads or if its an off topic question so as not to bog a thread down.
B so people can see where i went wrong and avoid the same mistakes :rolleyes:.

I am now going to bite down hard on a tea towel and scream expletifs until i calm down.
 
Last edited:
Back
Top