Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Detecting the number of COM ports?

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Suggested Solutions

Title # Comments Views Activity
repeateFront java challenge 31 94
Replacement selected text 2 63
wordappend challenge 8 199
unix example issues 18 98
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

766 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