Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Device not connected" on win10 #5

Open
Azq2 opened this issue Jun 15, 2024 · 3 comments
Open

"Device not connected" on win10 #5

Azq2 opened this issue Jun 15, 2024 · 3 comments

Comments

@Azq2
Copy link

Azq2 commented Jun 15, 2024

image

image

@johnstevenson
Copy link
Owner

Internally the app gets the connected device/driver usingpnputil.exe which is a standard Windows component.

So you can mimic what it is doing by running the following in a command prompt:

pnputil.exe /enum-devices /class {4d36e978-e325-11ce-bfc1-08002be10318} /drivers /connected

@Azq2
Copy link
Author

Azq2 commented Jun 15, 2024

Seems to be /drivers is not supported in my Windows 10 version.
I'm not sure if it a bug, because I used win10.iso downloaded 6 years ago....

PS C:\Users\admin> pnputil.exe /enum-devices /class '{4d36e978-e325-11ce-bfc1-08002be10318}' /connected
Microsoft PnP Utility

Instance ID:                USB\VID_067B&PID_2303\5&12c8f4c0&0&2
Device Description:         Prolific USB-to-Serial Comm Port (COM4)
Class Name:                 Ports
Class GUID:                 {4d36e978-e325-11ce-bfc1-08002be10318}
Manufacturer Name:          Prolific
Status:                     Started
Driver Name:                oem6.inf
PS C:\Users\admin> pnputil.exe /enum-devices /class '{4d36e978-e325-11ce-bfc1-08002be10318}' /drivers /connected
Microsoft PnP Utility

PNPUTIL [/add-driver <...> | /delete-driver <...> |
         /export-driver <...> | /enum-drivers |
         /enum-devices [<...>] | /enum-interfaces [<...>] | /?]

Commands:

  /?

    Show usage screen.

  /enum-devices [/connected | /disconnected] [/instanceid <instance ID>]
                [/class <name | GUID>] [/problem [<code>]] [/ids] [/relations]

    Enumerate all devices on the system.
      /connected | /disconnected - filter by connected devices or
                                   filter by disconnected devices.
      /instanceid <instance ID> - filter by device instance ID.
      /class <name | GUID> - filter by device class name or GUID.
      /problem [<code>] - filter by devices with problems or
                          filter by specific problem code.
      /ids - display hardware IDs and compatible IDs.
      /relations - display parent and child device relations.

    Examples:
      Enumerate only connected devices on the system:
        pnputil /enum-devices /connected
      Enumerate device with specific instance ID:
        pnputil /enum-devices /instanceid "ACPI\PNP0A08\1"
      Enumerate all devices with specific class:
        pnputil /enum-devices /class Display
        pnputil /enum-devices /class {4d36e97d-e325-11ce-bfc1-08002be10318}
      Enumerate all devices with specific problem code:
        pnputil /enum-devices /problem 28
        pnputil /enum-devices /problem 0xA
      Enumerate all devices with problems and display hardware/compatible IDs:
        pnputil /enum-devices /problem /ids
PS C:\Users\admin> [System.Environment]::OSVersion.Version

Major  Minor  Build  Revision
-----  -----  -----  --------
10     0      18362  0

@johnstevenson
Copy link
Owner

Thanks for the helpful insight. Indeed this is not supported on Windows 10 version 1903 (10.0.18362, May 2019 update).

The current documentation now states that /drivers is not available until Windows 10 version 2004 (10.0.19041, May 2020 update): https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/pnputil-command-syntax#enum-devices

However the documentation I used at the time of writing this (May 2022) showed /drivers being available in version 1903: https://web.archive.org/web/20221005150513/https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/pnputil-command-syntax#enum-devices

We need the /drivers option, because this returns a list of matching drivers for the device, which is difficult to correctly ascertain by other methods (enum-drivers for example). And is presumably why Microsoft added it.

I will update the minimum required Windows version to 2004 (May 2020 update), because unfortunately we cannot fix this.

johnstevenson added a commit that referenced this issue Jun 19, 2024
Microsoft documentation stated that the /drivers option for pnputil.exe
enum-devices was available in Windows 10 version 1903. However the
current documentation states that it is not available until Windows 10
version 2004.

Fixes #5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants