Solved

How do I free a locked com port?

Posted on 2010-09-15
7
1,523 Views
Last Modified: 2012-05-10
I’ve come across an annoying issue that I’d like to know if there’s a good solution for.

If there is data being transmitted to one of my PCs com ports when Windows XP starts up, XP decides the com port is in use and locks it from use. The only way I know of to “free” it is to shut down the PC, disconnect the device that was talking on the COM port, and reboot and then reconnect the device again. This is a huge hassle.

1) Is there a way to prevent Windows from “locking” the port so it’s not an issue anymore?
2) Is there a way to force Windows XP to allow the port to be used instead of requiring a hard shutdown and reboot?
0
Comment
Question by:enggarmin
  • 4
  • 2
7 Comments
 
LVL 66

Assisted Solution

by:johnb6767
johnb6767 earned 334 total points
ID: 33688538
1. Dont think so.... A good app would release the port once communication is done.....

2. You can forcibly close the port using the below.....

closecom.zip
http://www.filelibrary.com/Contents/OS2/64/16.html

Yes, it does state Windows 3.1 on it, but it works fine under XP. Simply launch the app, and it will ask you to forcibly close the port.

(not sure if thats a good link, might need to google it)

0
 
LVL 4

Assisted Solution

by:jlar310
jlar310 earned 166 total points
ID: 33688554
The serial port would be locked only if an application has opened it. You need to find out which application or service at startup is locking the port (possibly the UPS monitoring service?)

PortMon is a tool that should tell you what application is using the port.

http://technet.microsoft.com/en-us/sysinternals/bb896644.aspx

Then it's just a matter of not letting that application or service run at startup.  Or reconfiguring the application in some other way. It will depend on what the app is.
0
 

Author Comment

by:enggarmin
ID: 33693918
I've tried both of these softwares before (closecom and portmon) but didn't have much luck.  I'll try them again and see what I can find.  I 'll get back to you with the results.

The idea that it may be a service locking up the port (unrelated to the device) sounds promising. I'll see if PortMon can confirm that theory.

Thanks!!
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

Author Comment

by:enggarmin
ID: 33716587
no luck.

Clozecom fails to close the port.  "CloseCom for COM1: failed!"

Portmon fails to monitor the port.  "Portmon could not attach to Serial0 - the device may be in use"

Any more tips or suggestions?  I'm open to anything.
0
 
LVL 66

Assisted Solution

by:johnb6767
johnb6767 earned 334 total points
ID: 33718820
Do you know what device /service/app is locking it to begin with?

If not, the Process of Elimination would be a good place to start......

How to configure Windows XP to start in a "clean boot" state
http://support.microsoft.com/kb/310353

Start  by disabling all the startups, and check it out, and if that fails to get you access via Portmon, kill the non ms services, then retry....Still need to dig deeper, kill half the MS Services.... and retry, and once you find it is not locked on boot, you can restart enabling services/apps until you find the culprit.... Might very wekll be an unneeded service that still thinks it has something connected....
0
 

Author Comment

by:enggarmin
ID: 33719927
Thanks Johnb6767.  jlar310 suggested it might be a service and that seems like a likely path to investigate.  I should have thought of going though and turning off services as a way of finding which one it was.  I'll try that next and let you know.  
0
 

Accepted Solution

by:
enggarmin earned 0 total points
ID: 33730140
So I have the problem resolved and it really took a different turn so I'm not sure, really, how to best award points.  Thank you all for your help.

What I ultimately found when trying to track down what had it locked was that it was not a service that had it locked but it actually was being locked because Windows thought the device was a serial mouse.  I spent a while doing searches online for how to address it and ultimately found that most approachs don't work (Adding /fastdetect or /NoSerialMouse to the boot.ini, which did nothing).  I eventually was directed to two softwares.  One was from microsoft, http://support.microsoft.com/default.aspx?scid=kb;en-us;819036, that involved installing a com disable tool and disabling the port via a command line prompt.  The 2nd option was a software called NoSerialMouse that I downloaded from this site: http://www.marciowb.net/blog/2008/10/rapidinha-dispositivo-serial-windows (scroll down and click on "NoSerialMouse" in purple to download the software.  The site is not in English so I am not sure what it is doing but I assume something very similar to the first software.  This NoSerialMouse is much simpler to use.  I used it to disable the com port the device was on and after a reboot it no longer was locked by XP as a mouse and both Clozecom and PortMon now functioned properly but were not really needed as the port was free anyway.

I hope this information helps someone else who comes across this problem.  Thanks!!
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question