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 development Windows API - Win32
Developer technologies C#
{count} votes

3 answers

Sort by: Most helpful
  1. Doug Leary 21 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?

    3 people found this answer helpful.
    0 comments No comments

  2. Alberto Poblacion 1,571 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

  3. Alberto Poblacion 1,571 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.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.