?
Solved

Detecting the number of COM ports?

Posted on 1998-07-02
2
Medium Priority
?
206 Views
Last Modified: 2013-11-19
How to detect the number of serial (com) ports in the system?
.......
Ok, found the number in the registry ....
is there another way e.g. in a structure such as SYSINFO, COMMCONFIG ...?
0
Comment
Question by:nil092297
2 Comments
 

Author Comment

by:nil092297
ID: 1318623
Edited text of question
0
 
LVL 1

Accepted Solution

by:
Musashi earned 160 total points
ID: 1318624

See the following article

Q100372 : Detecting Windows NT Serial Ports

Basically, the structure which windows uses to maintain such information IS the registry, so you just need to read it from there.

There is also another article you might be interested in which also makes it obvious that the registry needs to be manipulated:

----------------------------------------------
Deleting Serial Ports
You can configure communication ports as described in the previous section or as described in "Serial Subkey Entries in the Services Subkey" in Chapter 14, "Registry Value Entries." You might also need to delete one or more COM ports, which you can only do by deleting the related Registry information in the DeviceMap and Services areas of the Registry. To delete entries in the DeviceMap subkey, you must be logged on as a member of the Administrators group.

To delete a COM port
In Registry Editor, delete the appropriate value entry for the COM port under the following Registry path:
HKEY_LOCAL_MACHINE\Hardware\DeviceMap\SerialComm

The value entries in this subkey are used to determine all the communication ports available on the system. The values are of the form Serialyyy=COMx, where COMx can be COM1 to COM256, and Serialyyy can be from Serial0 through any large positive number such as Serial15000.

You can identify the value entry you want to delete based on the list that appears when you choose the Ports icon in Control Panel.

Delete the COM port's related Serialyyy key in the following Registry path:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services
\Serial\Parameters\Serialyyy

If you do not delete the related Services subkey for Serialyyy, the COMx port continues to appear in the Ports list in Control Panel each time the system starts, even though there is no related DeviceMap subkey.
---------------------------------------------

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month13 days, 17 hours left to enroll

807 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