[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Find USB to Serial device via WMI

Posted on 2007-10-09
Medium Priority
Last Modified: 2013-11-26
I'm writing an appication that talks to a small symbol scanner.

I need a way to find teh serial port the scanner is connected to. It uses a serial to USB adaptor that I know the name of and could easily identify. I've been trying to locate the device using WMI with no luck. I've tried several classes including the  Win32_SerialPort class which returns the serial port that is on the motherboard but not the one created by the USB to serial adapter. Trying to search the USB devices hasn't gotten me any closer either.

Here is an example of some of the code I've tried:
Dim scope As New ManagementScope("\\.\root\cimv2")

      Dim objectQuery As New ObjectQuery("SELECT * FROM Win32_SerialPort")
      Dim searcher As New ManagementObjectSearcher(scope, objectQuery)
      Dim os As ManagementObject
      Dim moColl As ManagementObjectCollection = searcher.Get()
      Dim sep As String = vbCrLf
      For Each os In moColl
      Next os
Question by:Chad Penney
1 Comment
LVL 16

Accepted Solution

SQL_SERVER_DBA earned 1500 total points
ID: 20042011

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

872 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