3

Is there any way to force windows to recheck all devices against drivers in its database (HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\DevicePath) and update to the latest drivers available? Something similar to what sysprep does when a cloned HD image is starting for the first time.

For example: When you install windows on a motherboard some devices are recognized and installed automatically with drivers from the windows CD. Some others are not recognized, therefore, not installed. Normally, you use the MB CD to update all drivers. There are two ways to do that:

  1. .exe file: Just run that and (normally) it updates all drivers (recognized or not).

  2. .inf file: IF the device isn't recognized, the driver installation wizard will find the driver on the CD automatically, otherwise you will have to update by hand (Device Manager -> device properties -> ... -> Update driver) IF you know which devices have updated drivers on the MB CD. You can check the .inf files on the CD to find which are supported, but it is a painful process.

I normally modify the DevicePath registry key and use driver packs when I create a PC image to clone later (I work for an IT department), and sysprep take cares of the rest. But when you want to install a PC differently of the saved HD image (therefore, you don't use sysprep) this process doesn't apply.

What I want to do is:

  1. After windows is installed, decompress the driver packs to a folder.

  2. Modify DevicePath

  3. Force Windows to update to the newer drivers (_already_recognized_devices_ are the most important thing here, there is no pain in the unrecognized ones).

It's the third step I don't know how to do.

5 Answers5

2

Try using DevCon, a Microsoft utility.

The DevCon utility is a command-line utility that acts as an alternative to Device Manager. Using DevCon, you can enable, disable, restart, update, remove, and query individual devices or groups of devices.

As long as you unpack your drivers into a default search path, you could call a rescan to capture all the devices not installed initially.

Jack B Nimble
  • 1,505
  • 1
  • 10
  • 13
2

You can use DPInst.exe.

Here's a guide: http://blogs.technet.com/b/svengruenitz/...

This is the DPInst.xml file I use for silently updating all drivers.

<?xml version="1.0" ?>

<dpinst>

    <!-- Suppress the addition of entries to Programs and Features in 
    Control Panel.-->
    <suppressAddRemovePrograms/>

    <!-- install a driver package for a Plug and Play (PnP) function driver 
    only if the driver package matches a device that is configured in a 
    computer and the driver package is a better match for the device than 
    the driver package that is currently installed on the device. -->
    <scanHardware/>

    <!-- Suppress the display of user interface items that DPInst and 
    Windows generate. -->
    <quietInstall/>

    <!-- The following search and subDirectory elements direct
        DPInst to search all subdirectories (under the DPInst working
        directory) to locate driver packages. -->
    <search>
        <subDirectory>*</subDirectory>
    </search>
</dpinst>

You can also run DPInst.exe in command prompt with the /C flag to see what it's doing.

The DPInstall documentation is here: https://msdn.microsoft.com/...

Rich Webby
  • 21
  • 2
1

The article Script to install or update drivers directly from Microsoft Catalog contains a PowerShell script for doing it for all drivers.

The article includes good explanations of each part of the script. I reproduce below just the bare script with only minor changes (which I have not tested):

#search and list all missing Drivers

$Session = New-Object -ComObject Microsoft.Update.Session           
$Searcher = $Session.CreateUpdateSearcher() 

$Searcher.ServiceID = '7971f918-a847-4430-9279-4a52d1efe18d'
$Searcher.SearchScope =  1 # MachineOnly
$Searcher.ServerSelection = 3 # Third Party

$Criteria = "IsInstalled=0 and Type='Driver' and ISHidden=0"
Write-Host('Searching Driver-Updates...') -Fore Green  
$SearchResult = $Searcher.Search($Criteria)          
$Updates = $SearchResult.Updates

#Show available Drivers

$Updates | select Title, DriverModel, DriverVerDate, Driverclass, DriverManufacturer | fl

#Download the Drivers from Microsoft

$UpdatesToDownload = New-Object -Com Microsoft.Update.UpdateColl
$updates | % { $UpdatesToDownload.Add($_) | out-null }
Write-Host('Downloading Drivers...')  -Fore Green  
$UpdateSession = New-Object -Com Microsoft.Update.Session
$Downloader = $UpdateSession.CreateUpdateDownloader()
$Downloader.Updates = $UpdatesToDownload
$Downloader.Download()

#Check if the Drivers are all downloaded and trigger the Installation

$UpdatesToInstall = New-Object -Com Microsoft.Update.UpdateColl
$updates | % { if($_.IsDownloaded) { $UpdatesToInstall.Add($_) | out-null } }

Write-Host('Installing Drivers...')  -Fore Green  
$Installer = $UpdateSession.CreateUpdateInstaller()
$Installer.Updates = $UpdatesToInstall
$InstallationResult = $Installer.Install()
if($InstallationResult.RebootRequired) {  
Write-Host('Reboot required! please reboot now..') -Fore Red  
} else { Write-Host('Done..') -Fore Green }
Ace
  • 478
  • 1
  • 6
0

There is no generic method. If you have a Dell then Dell do a driver update package that will check all the Dell drivers and update them to the latest versions. You should be able to find it through the drivers area of the Dell web site by entering the tag number of your server.

JR

John Rennie
  • 7,776
  • 1
  • 23
  • 35
0

There are some (non free) programs that claim to do this for you. The 2 I can think of off the top of my head are:

Driver Robot

Driver Detective

I haven't used either of them so can't vouch for how good they are.

MattB
  • 11,194
  • 1
  • 30
  • 36