Solved

How do I free a locked com port?

Posted on 2010-09-15
7
1,441 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:enggarmin
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This is an article about my experiences with remote access to my clients (so that I may serve them) and eventually to my home office system via Radmin Remote Control. I have been using remote access for over 10 years and have been improving my metho…
Resolve DNS query failed errors for Exchange
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

763 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now