Solved

Detecting the number of COM ports?

Posted on 1998-07-02
2
175 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 80 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
This video discusses moving either the default database or any database to a new volume.

743 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

8 Experts available now in Live!

Get 1:1 Help Now