VB.NET WMI Does Not Detect Virtual COM Port

Posted on 2008-06-18
Last Modified: 2013-12-27
We were forced to use a USB-to-Serial adapter.  The attached code will not recognize the 'virtual serial port.'  Any way around this?  Or is this the way it is going to be when not using a 'TRUE' serial port?
Dim moReturn As Management.ManagementObjectCollection

        Dim moSearch As Management.ManagementObjectSearcher

        Dim mo As Management.ManagementObject

        moSearch = New Management.ManagementObjectSearcher("Select * from Win32_SerialPort")

        moReturn = moSearch.Get

        Dim Coms As New System.Collections.Specialized.StringCollection

        For Each mo In moReturn



            Debug.WriteLine("Win32_SerialPort instance")


            Debug.WriteLine("Description: {0}", CStr(mo.Properties.Item("Description").Value))

            Debug.WriteLine("DeviceID: {0}", CStr(mo.Properties.Item("DeviceID").Value))

            Debug.WriteLine("Name: {0}", CStr(mo.Properties.Item("Name").Value))

            Debug.WriteLine("Status: {0}", CStr(mo.Properties.Item("Status").Value))


Open in new window

Question by:jigdog
LVL 41

Accepted Solution

graye earned 500 total points
Comment Utility
So, what does the following give you?

    For Each port As String In My.Computer.Ports.SerialPortNames

Author Closing Comment

Comment Utility
Don't I feel like an idiot.  Still getting used to the convenient new methods and props in .net.  thanks!!

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Introduction When many people think of the WebBrowser ( control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Hi there, This article summarizes what you need if you are going to set up your home or small business Network Attached Storage (NAS) to be accessible from the internet. Of course there are configuration differences based on your NAS or router ma…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now