Here an improved version to list all drivers include version using Sigcheck from Sysinternals Tools:
@echo off
for /f "tokens=* delims=" %%a in ('driverquery /v /nh /fo csv') do (
SET str=%%a
SETLOCAL enabledelayedexpansion
SET str=!str:","=";"!
for /f "tokens=1,2,14 delims=;" %%d in (!str!) do (
ENDLOCAL
for /f "tokens=* delims=" %%v in ('sigcheck -accepteula -q -n "%%f"') do (
REM echo %%a,^"'%%v^"
echo ^"%%d,%%e,%%f,^"'%%v^"
REM echo ^"%%d,^"'%%v^"
)
)
)
pause
An extended version which writes the information directly to an csv file:
@echo off
set DRIVER_LOG="Drivers_%computername%.csv"
echo Drivers - %computername% - %date% > %DRIVER_LOG%
for /f "tokens=* delims=" %%a in ('driverquery /v /nh /fo csv') do (
SET str=%%a
SETLOCAL enabledelayedexpansion
SET str=!str:","=";"!
for /f "tokens=1,2,14 delims=;" %%d in (!str!) do (
ENDLOCAL
for /f "tokens=* delims=" %%v in ('sigcheck -accepteula -q -n "%%f"') do (
REM echo %%a,^"'%%v^" >> %DRIVER_LOG%
echo ^"%%d,%%e,%%f,^"'%%v^" >> %DRIVER_LOG%
REM echo ^"%%d,^"'%%v^" >> %DRIVER_LOG%
)
)
)
pause
Some variants are possible...
...for all details, please use:
echo %%a,^"'%%v^"
...for more details, please use (default):
echo ^"%%d,%%e,%%f,^"'%%v^"
...for short information, please use:
echo ^"%%d,^"'%%v^"
Annotation: If you open the created csv file in Excel and want to hide the text sign ' use
Find: "'" and Replace with: "'" in Excel (Yes, it's really the same!)
This script was tested with Windows XP and Windows 7!
(For Windows XP use an older version of Sigcheck! e.g. Sigcheck v2.02)
3This works great, thanks! If you want it for a particular device, do
Get-WmiObject Win32_PnPSignedDriver -Filter "DeviceName = 'NVIDIA GeForce GTX 770'" | select devicename, driverversion
. I search by device name, but you can search by other fields too; doGet-WmiObject Win32_PnPSignedDriver
for your options. – legends2k – 2017-09-26T19:04:24.603I wanted to see the drivers grouped by company, so I added a sort and another column:
Get-WmiObject Win32_PnPSignedDriver | Sort-Object -Property DriverProviderName, devicename | select devicename, driverversion, DriverProviderName, DriverDate
Note: the additional columns will only show up if your window is wide enough (use R-click title bar > Properties > Layout > Width). – PolyTekPatrick – 2018-08-13T04:33:21.847Remember that you can remove the headers with
| Format-Table -HideTableHeaders
– YePhIcK – 2019-04-02T19:28:13.223