Solved

Detecting the number of COM ports?

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
set up trigger (or something) to rename files (starting with ATL) in a linux directory 6 54
Doc'in system (example?) BA 7 112
FizzBuzz challenge 9 81
Not needed 13 113
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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

832 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