How To Disable Automatic Driver Updates on Windows 10

Windows Update Drivers

Recently I experienced problems with windows update messing up a Lenovo Thinkpad sound driver. I run Windows Update for Business through Intune. After a long period of troubleshooting different driver versions, I found out that Windows Update would install a bad driver on the machine.

So I went into the Intune portal, found Windows Update For Business, and disabled Windows drivers. Unfortunately, this didn’t solve the problem

So I figured there are probably a couple of registry keys that need to be set before the machine won’t download drivers through Windows Update.

I found the following three keys:

HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching\

HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata

HKLM:\SOFTWARE\Microsoft\Windows\WindowsUpdate

After setting the property in all three keys, it worked! windows stopped automatic driver updates.

Setting the DriverSearching Registry Key

The first key I will set has the following specs:

PropertyValuePath
SearchOrderConfig3HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching\

The different values available to the property

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching]

SearchOrderConfig 1 = No, let me choose what to do, Always install the best...
SearchOrderConfig 2 = No, let me choose what to do, Install driver software from windows update ...
SearchOrderConfig 3 = No, let me choose what to do, Never install driver software from Windows update

I will choose 3 to never install driver updates through Windows Update

To set the registry key I will use Powershell:

Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching\ -Name SearchOrderConfig -Value 3

Setting the PreventDeviceMetadataFromNetwork registry Key

The second key I will set has the following specs:

PropertyValuePath
PreventDeviceMetadataFromNetwork1HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata\

The property will have the values 0 to enable and 1 to disable the property. I will use 1 to disable the property.

I will use Powershell to set the registry key:

Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata\' -Name PreventDeviceMetadataFromNetwork -Value 1

Setting the ExcludeWUDriversInQualityUpdate registry key

The last key I will set has the following specs:

PropertyValuePath
ExcludeWUDriversInQualityUpdate1HKLM:\SOFTWARE\Microsoft\Windows\WindowsUpdate

The property will have the values 0 to enable and 1 to disable the property. I will use 1 to disable the property.

I will use Powershell to set the registry key:

Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\WindowsUpdate -Name "ExcludeWUDriversInQualityUpdate" -Value 1

Now there might be a chance that the key does not exist, and therefore you will need to create the key first.

to do this you can run the following:

New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\WindowsUpdate"

And then create the property:

New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\WindowsUpdate -Name ExcludeWUDriversInQualityUpdate -Value 1 -PropertyType DWORD 

Creating a complete script

So all there is left to do is to combine the Powershell commands into a functional script to run in Intune:

Write-Verbose -Message "Initiating Script"
Write-Verbose -Message "Looking at key: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching\ -Name SearchOrderConfig"
$item = Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching\ -Name SearchOrderConfig
if($item) {
    Try {
        Write-Verbose -Message "Key found. Setting property SearchOrderConfig -Value 0"
        Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching\ -Name SearchOrderConfig -Value 3
    }
    catch {
        Write-Error -Message "Failed setting the ItemProperty for SearchOrderConfig"
    }
}
else {
    Write-Verbose -Message "Key was not found. Setting Item Property: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching\ -Name SearchOrderConfig -Value 0 -PropertyType DWORD"
    New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching\ -Name SearchOrderConfig -Value 0 -PropertyType DWORD
}

Write-Verbose -Message "Looking at key: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata\ -Name PreventDeviceMetadataFromNetwork"
$item2 = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata\' -Name PreventDeviceMetadataFromNetwork
if($item2) {
    try {
        Write-Verbose -Message "Key found. Setting property  PreventDeviceMetadataFromNetwork -Value 1"
         Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata\' -Name PreventDeviceMetadataFromNetwork -Value 1
    }
    catch {
        Write-Error -Message "Failed setting the ItemProperty for PreventDeviceMetadataFromNetwork"
    }
}
else {
    Write-Verbose -Message "Key was not found. Setting the item property: 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata\' -Name PreventDeviceMetadataFromNetwork -Value 0 -PropertyType DWORD"
    New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata\' -Name PreventDeviceMetadataFromNetwork -Value 1 -PropertyType DWORD
}

if(!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\WindowsUpdate")){
    Write-Verbose -Message "Couldn't find the key: HKLM:\SOFTWARE\Microsoft\Windows\WindowsUpdate"
    Try {
        Write-Verbose -Message "Creating new key"
        New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\WindowsUpdate"   
        New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\WindowsUpdate -Name ExcludeWUDriversInQualityUpdate -Value 1 -PropertyType DWORD 
    }
    catch {
        Write-Error -Message "Failed creating the Key: HKLM:\SOFTWARE\Microsoft\Windows\WindowsUpdate"
    }
}
else {
    Write-Verbose -Message "Key was found, setting the new value: -Name ExcludeWUDriversInQualityUpdate -Value 1"
    Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\WindowsUpdate -Name "ExcludeWUDriversInQualityUpdate" -Value 1
}

Verify that the script worked

To verify that the script worked you can go through the registry editor and check the three keys has the correct values. You could also modify the script to output a test that the properties have been set with the correct values.

You can also check the advanced system settings to see if it was configured correctly.

Open the control panel and search for Advanced System:

Then click on “Hardware” and “Device Installation Settings”

You should now see the setting has been set to “No”

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *

This website uses cookies. By continuing to use this site, you accept our use of cookies.