get driver version via command line Windows

8

1

Is there a possibility to get the installed driver VERSION via command line on a Windows 7 system.

I've already tried driverquery but there is no information about the Version of the drivers, only a Linkdate. (By the way, what does that Link Date mean?)

I don't want tools or programs. I need a cmd line command.

Or can I get the version out of the registry?

user2145494

Posted 2013-03-18T16:26:54.710

Reputation: 81

Answers

9

Is there a possibility to get the installed driver version via command line

You can use the following PowerShell Script:

Get-WmiObject Win32_PnPSignedDriver| select devicename, driverversion

Example output:

PS F:\test> Get-WmiObject Win32_PnPSignedDriver| select devicename, driverversion

devicename                                                                                          driverversion
----------                                                                                          -------------
Generic volume                                                                                      6.1.7601.17514
Generic volume                                                                                      6.1.7601.17514
Generic volume shadow copy                                                                          6.1.7600.16385
Generic volume shadow copy                                                                          6.1.7600.16385
Generic volume shadow copy                                                                          6.1.7600.16385
Generic volume shadow copy                                                                          6.1.7600.16385
Generic volume shadow copy                                                                          6.1.7600.16385
Generic volume shadow copy                                                                          6.1.7600.16385
Generic volume shadow copy                                                                          6.1.7600.16385
Generic volume                                                                                      6.1.7601.17514
Generic volume                                                                                      6.1.7601.17514
Generic volume                                                                                      6.1.7601.17514
Volume Manager                                                                                      6.1.7601.17514
Microsoft Virtual Drive Enumerator Driver                                                           6.1.7601.17514
Cruzer                                                                                              6.1.7600.16385
UMBus Enumerator                                                                                    6.1.7601.17514
UMBus Enumerator                                                                                    6.1.7601.17514
UMBus Root Bus Enumerator                                                                           6.1.7601.17514
Atheros Bluetooth Bus                                                                               6.30.1208.302
Plug and Play Software Device Enumerator                                                            6.1.7601.17514
Terminal Server Mouse Driver                                                                        6.1.7601.17514
Terminal Server Keyboard Driver                                                                     6.1.7601.17514
WAN Miniport (SSTP)                                                                                 6.1.7601.17514
WAN Miniport (PPTP)                                                                                 6.1.7601.17514
WAN Miniport (PPPOE)                                                                                6.1.7601.17514

...

DavidPostill

Posted 2013-03-18T16:26:54.710

Reputation: 118 938

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; do Get-WmiObject Win32_PnPSignedDriver for your options. – legends2k – 2017-09-26T19:04:24.603

I 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.847

Remember that you can remove the headers with | Format-Table -HideTableHeaders – YePhIcK – 2019-04-02T19:28:13.223

3

You can use VBScript or JScript to get what you want. Since you didn't say for which driver you wanted the version number, here's a batch / JScript hybrid script that dumps them all to the console for you. Save this as driverversion.bat:

@if (@a==@b) @end /*
:: batch portion

@echo off
setlocal enabledelayedexpansion
for /f "delims=" %%I in ('driverquery /v /nh /fo csv') do (
    set idx=0
    for %%x in (%%I) do (
        set /a "idx+=1"
        if !idx!==1 (
            set /p "=%%~x version "<NUL
        ) else if !idx!==14 (
            if exist "%%~x" (
                cscript /nologo /e:jscript "%~f0" "%%~x"
            ) else echo N/A
        )
    )
)

goto :EOF

:: JScript portion */
WSH.Echo(new ActiveXObject("Scripting.FileSystemObject").GetFileVersion(WSH.Arguments(0)));

rojo

Posted 2013-03-18T16:26:54.710

Reputation: 523

2

You can use driverquery /v to include the driver files with the listing, but AFAICS you won't be able to get the version number from the files without additional software. One tool you could use would be sigcheck from SysIntern^WMicrosoft.

@echo off

for /f "delims=, tokens=14" %%d in ('driverquery /v /nh /fo csv') do (
  for /f %%v in ('sigcheck -accepteula -q -n "%%~d"') do (
    echo %%~d %%~v
  )
)

You can't get the version out of the registry, because the information is stored in the file itself.

The link date is probably the date when the file was linked, i.e. the creation date.

Ansgar Wiechers

Posted 2013-03-18T16:26:54.710

Reputation: 4 860

1

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)

user578243

Posted 2013-03-18T16:26:54.710

Reputation: 11

0

Best way is to use the following command:

driverquery /v /fo csv > D:\driverlist.csv

It will put all the driver details in csv file which is easy to see.

Sunil Karwasra

Posted 2013-03-18T16:26:54.710

Reputation: 1

Which one of the fields shown with the /v option is the version of the driver? – Jason Aller – 2015-03-04T05:58:16.300

Please read the question again carefully. Your answer does not answer the original question. driverquery does not display the driver version. – DavidPostill – 2015-03-04T07:06:20.127