Update/change device driver software in command line

  command-line, driver, windows

I want to replicate the following steps in the cmd line for updating device software.

Currently, I right-click on the device, select update driver, browse my computer for drivers, then select "Let me pick a list of available drivers".

Device driver software

I do it this way because I am basically changing which driver software that’s being used. I have to cycle through a number of different UPS batteries and want to achieve this in the cmd line. My end goal is an installer that will perform this step.

Please no 3rd party software, I really want to do this in cmdline

Currently, I have tried:

pnputil /add-driver battery.inf /install

this doesn’t show any errors but it isn’t changing the driver software.

I have also tried removing the driver package with pnputil but the device itself remains installed.


I can also achieve what I want if I uninstall the device via the device manager. I can’t replicate this in the cmd line either

Source: Windows Questions