Find serial number of USB device

kaveh rahimi 66 Reputation points
2021-06-22T09:39:16.76+00:00

Hi ,I want to find the serial number of CH341A device. How can I do that?
Please help
Thanks

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,824 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Xingyu Zhao-MSFT 5,371 Reputation points
    2021-06-23T01:49:15.533+00:00

    Hi @kaveh rahimi ,
    Add reference to 'System.Management', then try the code like:

            Dim theSearcher As ManagementObjectSearcher = New ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive WHERE InterfaceType='USB'")  
      
            For Each currentObject As ManagementObject In theSearcher.Get()  
                Dim theSerialNumberObjectQuery As ManagementObject = New ManagementObject()  
                theSerialNumberObjectQuery.Path = "Win32_PhysicalMedia.Tag='" & currentObject("DeviceID") & "'"  
                MessageBox.Show(theSerialNumberObjectQuery("SerialNumber").ToString())  
            Next  
    

    Hope it could be helpful.
    Best Regards,
    Xingyu Zhao
    *
    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.