如何更新所有 Windows 驅動程式?

如何更新所有 Windows 驅動程式?

有沒有辦法強迫windows重新檢查全部裝置對照其資料庫 (HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\DevicePath) 中的驅動程式並更新至可用的最新驅動程式?與首次啟動複製高清映像時 sysprep 執行的操作類似。

例如:當您在主機板上安裝 Windows 時,系統會自動辨識某些裝置並使用 Windows CD 中的驅動程式進行安裝。其他一些無法識別,因此無法安裝。通常,您會使用 MB CD 來更新所有驅動程式。有兩種方法可以做到這一點:

  1. .exe 檔案:只需執行該檔案(通常)它就會更新所有驅動程式(無論是否識別)。

  2. .inf 檔案:如果裝置無法識別,驅動程式安裝精靈將在 CD 上尋找驅動程式自動地,否則您將必須手動更新(裝置管理員 -> 裝置屬性 -> ... -> 更新驅動程式)如果您知道哪些裝置已更新 MB CD 上的驅動程式。您可以檢查 CD 上的 .inf 文件來查找受支援的文件,但這是一個痛苦的過程。

我通常會在建立 PC 映像以供稍後複製時修改 DevicePath 註冊表項並使用驅動程式套件(我在 IT 部門工作),其餘的則由 sysprep 負責。但是,當您想要以不同於已儲存的高畫質影像的方式安裝 PC 時(因此,您不使用 sysprep),此過程不適用。

我想做的是:

  1. windows安裝完成後,將驅動包解壓縮到一個資料夾中。

  2. 修改設備路徑

  3. 強制 Windows 更新到較新的驅動程式(_already_recognized_devices_ 是這裡最重要的事情,無法識別的裝置不會帶來任何痛苦)。

這是第三步,不知道怎麼做。

答案1

嘗試使用開發者大會,一個微軟實用程式。

DevCon 實用程式是命令列實用程序,可取代裝置管理員。使用 DevCon,您可以啟用、停用、重新啟動、更新、刪除和查詢單一裝置或裝置群組。

只要將驅動程式解壓縮到預設搜尋路徑中,您就可以呼叫重新掃描來擷取最初未安裝的所有裝置。

答案2

您可以使用 DPInst.exe。

這是一個指南:http://blogs.technet.com/b/svengruenitz/...

這是我用於靜默更新所有驅動程式的 DPInst.xml 檔案。

<?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>

您也可以在命令提示字元下使用 /C 標誌執行 DPInst.exe 以查看它在做什麼。

DPInstall 文件在這裡:https://msdn.microsoft.com/...

答案3

文章直接安裝或更新驅動程式的腳本Microsoft Catalog 中包含一個用於為所有驅動程式執行此操作的 PowerShell 腳本。

這篇文章對腳本的每個部分都有很好的解釋。我在下面複製了僅進行了微小更改的裸腳本(我尚未測試過):

#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 }

答案4

有一些(非免費)程序聲稱可以為您執行此操作。我能立即想到的兩個是:

駕駛機器人

司機偵探

我沒有使用過它們,所以不能保證它們有多好。

相關內容