7

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?

migrated from stackoverflow.com Mar 18 '13 at 19:53

This question came from our site for professional and enthusiast programmers.

8

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

...

  • 2
    This 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 Sep 26 '17 at 19:04
  • 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 Aug 13 '18 at 4:33
  • Remember that you can remove the headers with ` | Format-Table -HideTableHeaders` – YePhIcK Apr 2 at 19:28
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)));
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.

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)

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.

  • Which one of the fields shown with the /v option is the version of the driver? – Jason Aller Mar 4 '15 at 5:58
  • Please read the question again carefully. Your answer does not answer the original question. driverquery does not display the driver version. – DavidPostill Mar 4 '15 at 7:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.