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?

[Webinar] Streamline your web hosting managementRegister Today

intheConnect With a Mentor Commented:
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
All Courses

From novice to tech pro — start learning today.