473,386 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Access to Port COM1 is denied

Lee
I am getting this error trying to run a win forms .net app using the .net 2.0
serial port control. This occurs when the app tries to open the port. I knwo
this is some type of security access problem but I have no clue where to fix
it. Help....
Aug 17 '06 #1
5 55682
Lee
I believe I have discovered the problem here. The machine the app runs on has
2 comm ports and a PS/2 mouse. There are scales that send their weight via
the serial port 1 for each port. It appears that the operating system is
confusing the scale attached to com one as some type of system device and is
grabbing it. If I unplug the scale from com1 during boot, and plug it in
after logging in, the it works fine.

How can I keep the system from grabbing com1 during boot? I removed the
fastdetect option from boot.ini but that did no good.
Aug 17 '06 #2
"Lee" <Le*@discussions.microsoft.comwrote in message
news:CF**********************************@microsof t.com...
>I am getting this error trying to run a win forms .net app using the .net
2.0
serial port control. This occurs when the app tries to open the port. I
knwo
this is some type of security access problem but I have no clue where to
fix
it. Help....
No dotNet help here but.... you may have a device that's tying up Com1 and
not even know it. Mouse drivers are famous for that.

See: Available switch options for the Windows XP and the Windows Server 2003
Boot.ini files
http://support.microsoft.com/kb/833721/en-us

/fastdetect may be the culprit. We had to mess with Boot.ini on every NT4
machine we shipped because of this (fastdetect was called noserialmice on
NT4) We haven't had a problem since updating to Win2k though so.... I may be
way off.
--
Ken Halter - MS-MVP-VB (visiting from VB6 world) - http://www.vbsight.com
Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm
Aug 17 '06 #3
"Lee" <Le*@discussions.microsoft.comwrote in message
news:1E**********************************@microsof t.com...
>I believe I have discovered the problem here. The machine the app runs on
has
2 comm ports and a PS/2 mouse. There are scales that send their weight via
the serial port 1 for each port. It appears that the operating system is
confusing the scale attached to com one as some type of system device and
is
grabbing it. If I unplug the scale from com1 during boot, and plug it in
after logging in, the it works fine.

How can I keep the system from grabbing com1 during boot? I removed the
fastdetect option from boot.ini but that did no good.
hmmm... if anything fastdetect should be added, not removed.

Here's the NT4 doc we went by.

How to Disable Detection of Devices on Serial Ports
http://support.microsoft.com/kb/131976/

If that's correct, and the word has simply changed, you might want to try:

/fastdetect:COM1

or just

/fastdetect

<quote from http://support.microsoft.com/kb/833721/en-us>
/fastdetect:comnumber
This switch turns off serial and bus mouse detection in the Ntdetect.com
file for the specified port. Use this switch if you have a component other
than a mouse that is attached to a serial port during the startup process.
For example, type /fastdetect:comnumber, where number is the number of the
serial port. Ports may be separated with commas to turn off more than one
port. If you use /fastdetect, and you do not specify a communications port,
serial mouse detection is turned off on all communications ports.
Note In earlier versions of Windows, including Windows NT 4.0, this switch
was named /noserialmice.
</quote>

--
Ken Halter - MS-MVP-VB (visiting from VB6 world) - http://www.vbsight.com
Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm
Aug 17 '06 #4
Hi,

Look to see if some other application is using the port. The most common
cause of this problem is Windows itself. When Windows boots, it attempts to
identify (PnP) connected devices, including the posibility of a serial mouse
on Com1. If it "thinks" that it has detected a mouse, Windows assigns a
mouse driver to the port -- this means that the port CANNOT be used by any
other application!

What causes this? The way that Windows attempts to locate a mouse is by
toggling DTR and RTS during boot. It looks for serial data after this
toggle. And, unfortunately, Windows is not very smart about this. If it
sees ANY data (even data with framing, parity, or overrun errors), is still
says, "Mouse. Assign driver!" If you have some sort of device on Com1 that
spits out data at regular intervals, without a specific command, you system
will be subject to this problem.

The only real solution (the work arounds published in KB articles on the
subject simply do not work, IME), is to make sure that any device on Com1 is
disabled, or is not connected, until after Windows has finished PnP device
identification.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
Aug 18 '06 #5
Hi,

Yes, as you see from my other reply... The cause is a combination of Windows
and the device. As I said, the only solution is to make sure that the scale
is not connected during startup. The KB solutions simply do not work.

I have thought about marketing hardware that could be installed "in-line" to
solve this problem. However, the market seems rather small, so I haven't
pursued the idea.

BTW, I didn't mention the one solution that does work. Move the scale to
another input. I.e., spend a few $ on a serial to USB adapter, and use that
port. USB serial devices are not part of this PnP mouse fiddle-fardle.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
Aug 18 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: paritycheck | last post by:
Hi Guys, I'm stuck with a terribly persistant "Access to the path *** is denied" problem. I'm trying to upload a foile using the file control. The code checks if a file of the same name as...
0
by: Phadnis | last post by:
hi i want to build a vb.net applicaiton that would access the port 80 to get the content of the web page before it is displayed to the browser. since all the http request will go through the port...
3
by: karl | last post by:
I have a windows service that creates a monitor thread which in turn creates 4 worker threads. Each thread is based upon a derived class (HL7Listener) of the TcpListener class. When running this...
6
by: Kevin Quigley | last post by:
Hi, I have a configuration file which stores sql server connection details and some other application data, stored in a directory. When I try to access this file in my code, I get the following...
1
by: VB Programmer | last post by:
When I run this line: Dim sw As New System.IO.StreamWriter(strFileName) I get this error: System.UnauthorizedAccessException: Access to the path...
1
by: fripper | last post by:
I have a VB .Net 2003 web application and am using IIS 5.1 to check it out. The program accesses a data file in the c:\inetpub\wwwroot\_private folder but I get an access denied message. The...
2
by: bb | last post by:
when using the web deployment project to merge my aspnet assemblies i get an unusual error 'access to path denied' i double checked path looks ok, and gave everyone full perms on the folder and...
2
by: hsphuah | last post by:
I had looked a few previous posted newsgroup and tried a few of the suggestions by different users. None of them work. I hope that someone can help on my issue. For your information, my laptop...
6
Coldfire
by: Coldfire | last post by:
How can I know that which Application is accessing the port COM1/COM2/LPT/any ? Is there any software-utility available on net? plz help asap (i have moved the post from community cafe to here)
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.