Detecting the modem comport


How can I detect on which comport my modem is installed on?

I want to detect the exact port, and not all the ports I have in my computer.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Internal modems that are properly recognized and installed have a Win32 registry entry.  External modems (attached to a COM port) generally have no such entry.  To absolutely detect and verify an external modem (under Win32 or Win16), you have to open each COM port and send "AT"<CR> and listen for an "OK" response.  
When opening ports and scanning for modems, any port with CD high is currently in use (often by the mouse) and probably should not be disturbed.
Under Win32, the HyperString library has a function which will list all COM ports and identify any internal modems.  Also included are simple Win32 communications routines with an example showing how to use the routines to detect a modem. HyperString is freeware at

or look to
and get any of the com components (most come with demos) and use one of them to check the ports to find modem.
Regards Barry

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.