"Access is denied" message when redirecting console output to COM1

This is not explicitly a driver question, but has to do with COM1 being inaccessible when using a DOS command in the CMD window of Windows XP. I have two XP laptops that communicate with each other via modems attached to each of their serial ports. The COM ports for the modems and the laptops are configured identically and correctly.

In CMD, when I run a small C program to send a string from one laptop to the other using COM1, it works fine. The receiving laptop displays it on HyperTerm. However, when I tried typing

echo hello > COM1

while in CMD, nothing happened on the receiving laptop. Further, when I run a small C program while in CMD to do this with the line

system (“echo hello > COM1”);

I get an “Access is denied” message.

Any insight as to why this is occurring and how to work around it will be very much appreciated!
 
I think you already found a solution to your issue, but the reason this happens is because xp doesn't allow direct hardware communication the way that DOS/win31/win9x did.
 
Back
Top