- wdsutil get-device
- Syntax
- Parameters
- Examples
- CM_Get_Device_ID_ListA function (cfgmgr32.h)
- Syntax
- Parameters
- CM_GETIDLIST_FILTER_BUSRELATIONS
- CM_GETIDLIST_FILTER_CLASS (Windows 7 and later versions of Windows)
- CM_GETIDLIST_FILTER_PRESENT (Windows 7 and later versions of Windows)
- CM_GETIDLIST_FILTER_TRANSPORTRELATIONS (Windows 7 and later versions of Windows)
- CM_GETIDLIST_DONOTGENERATE
- CM_GETIDLIST_FILTER_EJECTRELATIONS
- CM_GETIDLIST_FILTER_ENUMERATOR
- CM_GETIDLIST_FILTER_NONE
- CM_GETIDLIST_FILTER_POWERRELATIONS
- CM_GETIDLIST_FILTER_REMOVALRELATIONS
- CM_GETIDLIST_FILTER_SERVICE
- Return value
- Remarks
- CM_Get_Device_Interface_ListA function (cfgmgr32.h)
- Syntax
- Parameters
- CM_GET_DEVICE_INTERFACE_LIST_ALL_DEVICES
- CM_GET_DEVICE_INTERFACE_LIST_PRESENT
- Return value
- Remarks
- Examples
- How to get a list of all Device Drivers using Command Prompt
- Generate a list of Drivers using driverquery command
- Related Posts
- CSR8510 A10 Driver is Unavailable error in Windows 10
- The Realtek Network Controller not found in Device Manager
- How to uninstall a program using Command Prompt in Windows 10
- [email protected]
- How to get connected USB device list from windows by using python or cmd
- 2 Answers 2
wdsutil get-device
Applies to: Windows Server (Semi-Annual Channel), Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Retrieves Windows Deployment Services information about a prestaged computer (that is, a physical computer that has been lined to a computer account in active directory Domain Services.
Syntax
Parameters
Parameter | Description |
---|---|
/Device: | Specifies the name of the computer (SAMAccountName). |
/ID: | Specifies either the MAC address or the UUID (GUID) of the computer, as shown in the following examples. Note that a valid GUID must be in one of two formats binary string or GUID string |
— Binary string: /ID:ACEFA3E81F20694E953EB2DAA1E8B1B6
— MAC address: 00B056882FDC (no dashes) or 00-B0-56-88-2F-DC (with dashes)
— GUID string: /ID:E8A3EFAC-201F-4E69-953-B2DAA1E8B1B6
Examples
To get information by using the computer name, type:
To get information by using the MAC address, type:
To get information by using the GUID string, type:
CM_Get_Device_ID_ListA function (cfgmgr32.h)
The CM_Get_Device_ID_List function retrieves a list of device instance IDs for the local computer’s device instances.
Syntax
Parameters
Caller-supplied pointer to a character string that is either set to a subset of the computer’s device instance identifiers (IDs), or to NULL. See the following description of ulFlags.
Address of a buffer to receive a set of NULL-terminated device instance identifier strings. The end of the set is terminated by an extra NULL. The required buffer size should be obtained by calling CM_Get_Device_ID_List_Size.
Caller-supplied length, in characters, of the buffer specified by Buffer.
One of the following caller-supplied bit flags that specifies search filters:
CM_GETIDLIST_FILTER_BUSRELATIONS
If this flag is set, pszFilter must specify a device instance identifier. The function returns device instance IDs for the bus relations of the specified device instance.
CM_GETIDLIST_FILTER_CLASS (Windows 7 and later versions of Windows)
If this flag is set, pszFilter contains a string that specifies a device setup class GUID. The returned list contains device instances for which the property (referenced by the CM_DRP_CLASSGUID constant) matches the specified device setup class GUID.
The CM_DRP_CLASSGUID constant is defined in Cfgmgr32.h.
CM_GETIDLIST_FILTER_PRESENT (Windows 7 and later versions of Windows)
If this flag is set, the returned list contains only device instances that are currently present on the system. This value can be combined with other ulFlags values, such as CM_GETIDLIST_FILTER_CLASS.
CM_GETIDLIST_FILTER_TRANSPORTRELATIONS (Windows 7 and later versions of Windows)
If this flag is set, pszFilter must specify the device instance identifier of a composite device node (devnode).
The function returns the device instance identifiers of the devnodes that represent the transport relations of the specified composite devnode.
For more information about composite devnodes and transport relations, see the following Remarks section.
CM_GETIDLIST_DONOTGENERATE
Used only with CM_GETIDLIST_FILTER_SERVICE. If set, and if the device tree does not contain a devnode for the specified service, this flag prevents the function from creating a devnode for the service.
CM_GETIDLIST_FILTER_EJECTRELATIONS
If this flag is set, pszFilter must specify a device instance identifier. The function returns device instance IDs for the ejection relations of the specified device instance.
CM_GETIDLIST_FILTER_ENUMERATOR
If this flag is set, pszFilter must specify the name of a device enumerator, optionally followed by a device ID. The string format is EnumeratorName\ , such as ROOT or ROOT\*PNP0500.
If pszFilter supplies only an enumerator name, the function returns device instance IDs for the instances of each device associated with the enumerator. Enumerator names can be obtained by calling CM_Enumerate_Enumerators.
If pszFilter supplies both an enumerator and a device ID, the function returns device instance IDs only for the instances of the specified device that is associated with the enumerator.
CM_GETIDLIST_FILTER_NONE
If this flag is set, pszFilter is ignored, and a list of all devices on the system is returned.
CM_GETIDLIST_FILTER_POWERRELATIONS
If this flag is set, pszFilter must specify a device instance identifier. The function returns device instance IDs for the power relations of the specified device instance.
CM_GETIDLIST_FILTER_REMOVALRELATIONS
If this flag is set, pszFilter must specify a device instance identifier. The function returns device instance IDs for the removal relations of the specified device instance.
CM_GETIDLIST_FILTER_SERVICE
If this flag is set, pszFilter must specify the name of a Microsoft Windows service (typically a driver). The function returns device instance IDs for the device instances controlled by the specified service.
Note that if the device tree does not contain a devnode for the specified service, this function creates one by default. To inhibit this behavior, also set CM_GETIDLIST_DONOTGENERATE.
If no search filter flag is specified, the function returns all device instance IDs for all device instances.
Return value
If the operation succeeds, the function returns CR_SUCCESS. Otherwise, it returns one of the CR_-prefixed error codes defined in Cfgmgr32.h.
Remarks
Starting with Windows 7, a device that supports multiple transport paths for packet-based data is referred to as a composite device and is represented by a composite devnode. A composite devnode logically represents the composite device to the user and applications as a single device, even though the composite devnode can have multiple paths to the physical device.
Each active transport path to the physical device is represented by a transport devnode and is referred to as a transport relation for the composite device.
The composite devnode (but not the related transport devnodes) exposes device interfaces to applications and the system. When an application uses these public device interfaces, the composite device routes the packet-based data to one or more of these transport devnodes, which then transport the data to the physical device.
For example, if a physical cell phone is simultaneously connected to the computer on the USB and the Bluetooth buses, each bus enumerates a child transport devnode on that bus to represent the device’s physical connection.
In this case, if you set the CM_GETIDLIST_FILTER_TRANSPORTRELATIONS flags in ulFlags and specify the device instance ID of the cell phone’s composite devnode in pszFilter, the function returns the device instance IDs for the two transport devnodes in the Buffer parameter.
For more information about device instance IDs, see Device Identification Strings.
The cfgmgr32.h header defines CM_Get_Device_ID_List as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
CM_Get_Device_Interface_ListA function (cfgmgr32.h)
The CM_Get_Device_Interface_List function retrieves a list of device interface instances that belong to a specified device interface class.
Syntax
Parameters
Supplies a GUID that identifies a device interface class.
Caller-supplied pointer to a NULL-terminated string that represents a device instance ID. If specified, the function retrieves device interfaces that are supported by the device for the specified class. If this value is NULL, or if it points to a zero-length string, the function retrieves all interfaces that belong to the specified class.
Caller-supplied pointer to a buffer that receives multiple, NULL-terminated Unicode strings, each representing the symbolic link name of an interface instance.
Caller-supplied value that specifies the length, in characters, of the buffer pointed to by Buffer. Call CM_Get_Device_Interface_List_Size to determine the required buffer size.
Contains one of the following caller-supplied flags:
CM_GET_DEVICE_INTERFACE_LIST_ALL_DEVICES
The function provides a list containing device interfaces associated with all devices that match the specified GUID and device instance ID, if any.
CM_GET_DEVICE_INTERFACE_LIST_PRESENT
The function provides a list containing device interfaces associated with devices that are currently active, and which match the specified GUID and device instance ID, if any.
Return value
If the operation succeeds, the function returns CR_SUCCESS. Otherwise, it returns one of the error codes with the CR_ prefix as defined in Cfgmgr32.h.
The following table includes some of the more common error codes that this function might return.
Return code | Description |
---|---|
CR_BUFFER_SMALL | The Buffer buffer is too small to hold the requested list of device interfaces. |
Remarks
Between calling CM_Get_Device_Interface_List_Size to get the size of the list and calling CM_Get_Device_Interface_List to get the list, a new device interface can be added to the system causing the size returned to no longer be valid.В Callers should be robust to that condition and retry getting the size and the list if CM_Get_Device_Interface_List returns CR_BUFFER_SMALL.
Examples
This snippet illustrates retrying getting the size and the list as described in the Remarks section.
The cfgmgr32.h header defines CM_Get_Device_Interface_List as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
How to get a list of all Device Drivers using Command Prompt
Device Drivers are one of the main reasons why your computer is running at the optimal performance today; they can also be one of the reasons why your computer is running slowly. When things are running well, computer users might want to view a list of the drivers that are operational. This can be a difficult process, which is why we are going to talk about how to view a list of all device drivers via the Command Prompt by using the driverquery command.
First we need to kick start the Command Prompt app, and for this to happen, users may open the WinX menu in Windows 10 or Windows 8.1 and click on Command Prompt. Another way of doing it is to press the Windows Key along with R, and then type CMD in the text box. Hit enter and watch as the Command Prompt launches.
Generate a list of Drivers using driverquery command
In the Command Prompt, enter the command driverquery . This should bring up a list of drivers installed on the system. Depending on the number of drivers installed, it may take a while for the screen to fully populate. A relatively fast computer should perform these tasks within just a few seconds after the user hits the enter button.
Using the driverquery command will show the module name of the driver, along with the display name, driver type, and link date. However, that is not all, because it is possible to generate more information about these drivers just by using a different parameter.
Type driverquery /v to generate the list similar to the one below:
To generate an even more detailed list, use driverquery /FO list /v .
It shows a lot more, including information on whether or not a driver is running. We understand that this one should be more adequate for advanced users, so we would recommend starting things off with driverquery /FO list /v instead of driverquery .
While using the Command Prompt removes the need for installing another app, some users might not feel right at home, so we suggest using an app called DriverView. It does almost everything driverquery does and more. It is a powerful app, and as such, we recommend it to novices since it is more straightforward than using the Command Prompt.
Date: July 30, 2018 Tags: CMD, Drivers
Related Posts
CSR8510 A10 Driver is Unavailable error in Windows 10
The Realtek Network Controller not found in Device Manager
How to uninstall a program using Command Prompt in Windows 10
[email protected]
Vamien McKalin possesses the awesome power of walking on water like a boss. He’s also a person who enjoys writing about technology, comics, video games, and anything related to the geek world.
How to get connected USB device list from windows by using python or cmd
I need to get connected USB device list from windows by using python or cmd.
for python i’m trying this.
as a result i get this:
but i don’t get a meaning full name.
and for cmd i’m trying this also:
and again i don’t get any meaning full name for connected usb devices.
when I’m connect a mouse, keyboard, pen drive or printer through the usb i want this kind of name. like ‘a4tech mouse’ or even if i get ‘mouse’ only that’s also be fine. This type of name appears in the device section of the settings of windows 10. but i get ‘USB Root Hub (USB 3.0)’, ‘USB Composite Device’, which means nothing actually. Is it possible with python?
If any one know this answer please help. Its very important for me.
2 Answers 2
Not sure if it’s what you are looking for, but using Python 3 on Windows 10 with pywin32, you could use this to get all your drive letters and types:
Your USB devices have the type win32file.DRIVE_REMOVABLE — so this is what you’re looking for. Instead of printing all drives and types, you could insert an if condition to only process such removable devices.
Please note: SD-Cards and other removable storage media has the same drive type.
Update, 13. July 2020:
To get further Inforrmations about connected Devices, have a look at the WMI Module for Python.
Check this example outputs, they list different informations about devices, including Manufacturer Descriptions, Serial Numbers and so on:
To access a specific Information listed in this output, use the displayed Terms for direct access. Example: