Automatically Update Drivers?

This topic contains 4 replies, has 2 voices, and was last updated by Profile photo of Vincent Morris Vincent Morris 1 year, 8 months ago.

  • Author
    Posts
  • #23406
    Profile photo of Vincent Morris
    Vincent Morris
    Participant

    Hey everyone,

    I need help looking for the solution to what I fear is a rare problem. Since nowadays people generally inject drivers when capturing a windows image, there is generally not a need for the script I'm trying to create. However in this case, I need to update drivers for multiple machines, with differing models, but the driver packages are downloaded to a folder that is on all of these machines. By hand, I would generally go to the device manager, Right click on the drivers that need to be updated, browse my computer for the driver software, and point to the folder. Windows would then of course search the folder for the driver files, and automatically update them for me. Is there anyway I can script that functionality?

    I think this command is a step in the right direction because it tell mes which drivers are "broken"
    Get-WmiObject Win32_PNPEntity | Where-Object{$_.ConfigManagerErrorCode -ne 0} | Select Name, DeviceID

    Please let me know if you all have any ideas on how to script this functionality.

    Thanks,
    Vincent Morris

  • #23407
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    You can use pnputil.exe with the -a parameter for that. You don't even really need to try to figure out which drivers to install; just do them all, and let Windows figure it out. Something like this:

    Get-ChildItem C:\Drivers -Recurse -Include *.inf |
    ForEach-Object {
        pnputil.exe -a $_.FullName
    }
    
  • #23598
    Profile photo of Vincent Morris
    Vincent Morris
    Participant

    Is there a way to surpass the Windows security message for unsigned drivers?

  • #23599
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    Not that I'm aware of, unless you modify your security settings so it just installs unsigned drivers without prompting. That's a security thing; you have to decide how easy you want it to be for unsigned, potentially malicious code to be installed.

  • #23606
    Profile photo of Vincent Morris
    Vincent Morris
    Participant

    Well whats weird is I downloaded these drivers from the Dell and Lenovo sites, I'm not sure why they are considered unsigned. Darn, I was hopping I would be able to pass a -Force or /Quiet but that didn't work. I will have to temporarily disable the security setting. Thanks for your help!

You must be logged in to reply to this topic.