2010. 12. 17. 07:35

How do I determine which process is using a serial port?

source: http://stackoverflow.com/questions/42197/how-do-i-determine-which-process-is-using-a-serial-port


1. You can use the process explorer tool also from SysInternals to search for open handles. In this case you would want to search for 'Serial' since it uses device names that may not map to com port numbers. (e.g. COM1 is \Device\Serial0 on my system).

If you want to take control of the serial port from another app I think you would need co-operation of the driver.


2. Sysinternals has a slew of utilities I find very useful and educational for tracking down what processes are doing to the system.

They have a utility that does exactly what you need called Portmon, and give some information on how it works near the bottom of the page. That info and a few well-asked questions will probably give you everything you need to implement it yourself if the utility isn't enough