List Windows Drivers from the Command Prompt

drivers-from-command-prompt

Do you know what's installed?

If you’ve had your PC running for any length of time, then you’ve no doubt added and removed hardware since Windows was first installed.  Even if you uninstall the hardware, there may still be traces of the drivers on your system, and possibly even multiple versions that could cause conflicts.

Even if you have a “semi-closed” system like a laptop, there are many drivers that get installed for even the simplest of “add-on” devices.  Have you noticed that plugging in a USB drive prompts Windows to find the proper drivers?  For general hardware like USB and hard drives, the OS uses Microsoft’s default drivers that ship with the OS, so this usually isn’t a problem. But you may have noticed that if you plug the same USB drive into a different USB port that Windows may “reinstall” the driver?

Fortunately you can compile a list of all the drivers installed on your system (including drivers not in use and “signed” drivers).  This list will even give you the driver’s files, name, description, version, and tons of other useful information.  You can even export the data in nearly any raw format, such as a comma-delimited file (CSV), table, or a simple list.  You can even extract this information from other computers on your network (provided you have access rights).  This tool can be invaluable not only to the IT professional, but home users as well.

The little tool that gets all of this information for you is called DRIVERQUERY, and can be run from the command prompt.

Here are the available parameter switches and what they do:

DRIVERQUERY optional parameters
switch switch name description
/S system Specifies the remote system to connect to.
/U [domain\]user Specifies the user context under which the command should execute.
/P password Spedicy the password for the given user context.
/FO format Specifies the type of output to display.  Valid values to be passed with teh switch are “TABLE”, “LIST”, “CSV”
/NH Specifies that the “Column Header” should not be displayed.  Valid for “TABLE” and “CSV” format only.
/SI Provides information about signed drivers.
/V Displays verbose output.  Not valid for signed drivers.
/? Displays a help message

To generate a simple list, just type driverquery at the command prompt.


To get verbose output, add the /V parameter.

driverquery /v

By default the information is displayed in a table format, but you can generate the list using a comma-delimited (CSV) format.  This can be helpful if you need to process this information in a spreadsheet (or even import into a database):

driverquery /FO csv

So for instance, if you ran the following command to give you verbose information in list format:

driverquery /FO list /v

Once you find a format that works for you, you can save the output to a text file, and then use your favorite text editor (I personally use UltraEdit) to search through.  This is especially useful if you’re compiling driver lists from several computers, so you can have a seperate file for each PC.

driveryquery > c:\driverlist.txt

Alan is a web architect, stand-up comedian, and your friendly neighborhood Grammar Nazi. You can stalk him on the Interwebs via Google+, Facebook and follow his ass on Twitter @ocmodshop.