Windows 7 Forcibly Change Driver Remotely Using devcon

=Example driver update for a HP Laserjet P2055 printer=

Plugging a P2055 into Windows7 will automatically install the Universal Driver if they already present on the machine - just adding the P2055 drivers remotely won't change it as it thinks the Universal ones are best. You need to forcibly change the universal ones to the 'proper' ones!


 * Note have renamed 64bit devcon.exe to devcon64.exe


 * Note I have used psexec to remote in to make it simpler, (I think you could use -m:\\remove_machine instead - test this, todo)

find anything relating to HP in the instance ID's
The relevant ones are the 'HP USB EWS-FX Bulk Driver' aka HP EWS P2050 Series, USB\VID_03F0&PID_5C17&MI_01

and

the actual printer driver 'HP Universal Printing PCL 6', USBPRINT\HEWLETT-PACKARDHP_LASERJET_P2055D

Find relevant hardware ID's from Instance ID's (nodes)

 * Note remember instance ID's, prefix with '@'

EWS hardware ID

 * Note subtle difference between node ID and Hardware ID (REV0001 bit)

Find correct .inf, search using Hardware ID
Look through the inf files for the relevant one for each device, findstring is looking for either of these strings "Hewlett-PackardHP_La39AE" or "VID_03F0&PID_5C17"

Above is the printer driver inf

Above is the EWS driver inf


 * Note these is a 3rd *.inf viz hpcp613.inf that will match, this is the 32bit drivers - in this example I want the 64 bit ones in hppdp613.inf

Update drivers
Basic pattern is

devcon 

Check printer driver node

 * Note Is Using node 1

Check printer using new driver files

 * Note they exist in c:\Windows\System32\spool\drivers\x64\3, not C:\Windows\system32\spool\DRIVERS\x64\{5F501CAB-4110-4FB3-B274-94DF3F020FAC}


 * Note Using drivernode 1, the right driver, cached as oem173.inf (i.e. "Driver installed from C:\Windows\INF\oem173.inf" )