Windows 10 declare COM port "access denied"

Frank Natoli 71 Reputation points
2020-12-19T16:06:28.507+00:00

Two existing EXEs, one written in C++ and Windows SDK, one written in C# and .NET 4.5.1, suddenly cannot open COM ports, "access denied". HyperTrm.exe has no problem opening the same ports that both EXE cannot open. Some recent update for Windows 10 has caused this problem. What is necessary to regain access to the COM ports?

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,427 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,285 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Alberto Poblacion 1,556 Reputation points
    2020-12-25T08:16:44.82+00:00

    Make sure that the port is not already open by another program that uses TAPI, such as a Fax program. Hyperterminal is TAPI-compliant, so it can use grab the port away from the other TAPI program. This would explain why Hyperterminal has no problem opening the port while your own program fails with "access denied".

    1 person found this answer helpful.
    0 comments No comments

  2. Doug Leary 6 Reputation points
    2021-12-13T17:25:20.24+00:00

    Every online discussion of COM port Access Denied errors says the same thing - make sure the COM port is not in use by another program. Does Windows have a BUILT-IN way to "make sure" or do I have to look for a 3rd party tool?

    1 person found this answer helpful.
    0 comments No comments

  3. Alberto Poblacion 1,556 Reputation points
    2021-12-13T17:54:32.317+00:00

    Well, you can use netstat -an to see if the port appears in the list of ports in use.
    Netstat has additional options that you can see by means of "netstat -?". If I remember correctly, one of these options lists which is the program that is using the port.

    1 person found this answer helpful.