Help designing a batch file to return driver information
Posted: 10 Dec 2023 17:34
Hi all,
I'm looking to create a batch file that returns driver information about all connected devices in a specific device class. In this case smartcard readers.
It should look through the results of 'pnputil /enum-devices /drivers /class "smartcardreader"' to find the 'Matching Drivers' attribute and return the following information for each occurance of it. The information appears after the attribute as follows:
- Driver Name
- Original Name
- Provider Name
- Driver Version
- Matching Device ID
I would also like the 'device description' to appear first however this attribute appears before 'Matching Drivers'.
I've included an example below of results from the pnputil command. The information should also be outputted to a text file. Any help would be greatly appreciated.
Instance ID: USB\VID_076B&PID_3031\7&3adb5428&0&1
Device Description: OMNIKEY 3x21
Class Name: SmartCardReader
Class GUID: {50dd5230-ba8a-11d1-bf5d-0000f805f530}
Manufacturer Name: HID Global
Status: Started
Driver Name: oem39.inf
Matching Drivers:
Driver Name: oem39.inf
Original Name: omnikey3x21.inf
Provider Name: HID Global
Class Name SmartCardReader
Class GUID: {50dd5230-ba8a-11d1-bf5d-0000f805f530}
Driver Version: 12/13/2016 1.0.0.2
Matching Device ID: USB\VID_076B&PID_3031
Driver Rank: 00FF0001
Driver Status: Best Ranked / Installed
Driver Name: wudfusbcciddriver.inf
Provider Name: Microsoft
Class Name SmartCardReader
Class GUID: {50dd5230-ba8a-11d1-bf5d-0000f805f530}
Driver Version: 06/21/2006 10.0.19041.1
Matching Device ID: USB\Class_0B&SubClass_00&Prot_00
Driver Rank: 00FF2000
Driver Status: Outranked
I'm looking to create a batch file that returns driver information about all connected devices in a specific device class. In this case smartcard readers.
It should look through the results of 'pnputil /enum-devices /drivers /class "smartcardreader"' to find the 'Matching Drivers' attribute and return the following information for each occurance of it. The information appears after the attribute as follows:
- Driver Name
- Original Name
- Provider Name
- Driver Version
- Matching Device ID
I would also like the 'device description' to appear first however this attribute appears before 'Matching Drivers'.
I've included an example below of results from the pnputil command. The information should also be outputted to a text file. Any help would be greatly appreciated.
Instance ID: USB\VID_076B&PID_3031\7&3adb5428&0&1
Device Description: OMNIKEY 3x21
Class Name: SmartCardReader
Class GUID: {50dd5230-ba8a-11d1-bf5d-0000f805f530}
Manufacturer Name: HID Global
Status: Started
Driver Name: oem39.inf
Matching Drivers:
Driver Name: oem39.inf
Original Name: omnikey3x21.inf
Provider Name: HID Global
Class Name SmartCardReader
Class GUID: {50dd5230-ba8a-11d1-bf5d-0000f805f530}
Driver Version: 12/13/2016 1.0.0.2
Matching Device ID: USB\VID_076B&PID_3031
Driver Rank: 00FF0001
Driver Status: Best Ranked / Installed
Driver Name: wudfusbcciddriver.inf
Provider Name: Microsoft
Class Name SmartCardReader
Class GUID: {50dd5230-ba8a-11d1-bf5d-0000f805f530}
Driver Version: 06/21/2006 10.0.19041.1
Matching Device ID: USB\Class_0B&SubClass_00&Prot_00
Driver Rank: 00FF2000
Driver Status: Outranked