9

I want to use the Windows command line to enumerate through devices connected to a computer and return information.

How can I accomplish this?

3 Answers 3

11

You do this by using the devcon.exe utility.

It ships with Windows Driver Kit. Select just the Tools in the installation wizard if you do not need the rest of the kit.

Refer to The DevCon command-line utility functions as an alternative to Device Manager for specific commands. I imagine you would start with something like

devcon find *
6

In 2023 Microsoft suggests using PnPUtil instead of devcon. PnPUtil is included in every version of Windows, starting with Windows Vista.

To view a list of devices from command line use:

pnputil /enum-devices /connected

More usage examples can be found here.

2

Try PowerShell's Get-PnpDevice

This seems to be the more modern version of things like devcon.exe or pnputil.exe.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .