Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have a device connected to my serial port which is putting data into my serial port.I want to use a DOS command to read the incoming data.
I've tried:-
COPY com1 text.txt
But that just hangs DOS.
How can I get strings of text coming in through the serial port to a file so I can process the text?
Thanks!

Stated that XP has no DOS at all, only an emulator (NTVDM) working side by side with the NT System Console (the so called DOS Prompt), you need a device driver and, may be, a specific application to process data from your serial device.
Copy *sends* data from a file to a port, not backward.
Anyway there is no DOS/NT command to accomplish your (at first sight) easy job.

The NT System Console is actually called "(NT) Command Prompt" in WinNT/2K/XP, not "DOS Prompt"(as in Win3.x/9x).
I would suggest the webmaster of Computing.Net to open a separate "WinNT Console Forum" or "WinNT Console Batch Forum" because we don't want to state "WinNT/2K/XP has no DOS at all" over and over.

HERE! HERE! totally agree Weinger, looking forward to no VDM in the replacement for XP!
As to using DOS in NT see:
http://www.windowsitlibrary.com/Content/226/03/1.html

As usual, Weingeirieirieir has overstated the answer. If the average user can't understand that Nt/XP has "no DOS" or "no DOS prompt" then how is he/her going to concieve an "NT console"?
Maybe what we need is a forum LABELED "NT or XP DOS QUESTIONS" and then a header at the top that explains "Now that you've made it to the "XP DOS PROMPT FORUM" there really is no such.. ..........etc

Thanks for all the replies!I couldn't care less if XP actually uses DOS or not - I did actually already know that is a 32 bit OS. You should know that XP comes with a "command prompt" that for most intents and purposes appears to respond to commands in the same way as earlier version of DOS in 16 bit Windows OS. So I _do_ program in DOS on my Windows XP machine.
Having posted the question, I had a really thorough search through the archives and eventually found the answer I needed:-
MODE COM1: baud=4800 parity=N data=8 stop=1
TYPE command > COM1
COPY COM1 text.txtOnly problem now is I can't persuade the command to stop receiving data - I have to press CONTROL-C to break it.
For my next trick I want to perform trigonometric functions with the SET command :-)
Thanks again!

Just call it NT/XP 'DOS' with a explanation at top as already suggested and place it directly under Windows XP.
Problem is you will still get a mix of 'Pure DOS' & 'XP DOS' problems posted in both. as you already do with DOS & Windows 3.1!
You cannot really win!!
Can a "suggest to move to a different forum" feature be introduced? so that moderators can move posts to the correct location??

Mick C, yes I would like to see that happen, whatever Lucy-jo may think, it is not DOS it is an emulation, because all cars operate on the same principal does not make them all Fords does it????? NO NO NO
I hope that we can have a NT VDM forum for NT4/W2K/XP..........

name,
PLEEEAAASE STOP SAYING THAT. NT Console batches and DOS batches are usually quite different!
For example, I don't think the following NT Console batch program will even work in real DOS:
for /f "tokens=2-4* delims=/ " %%a in ('DATE /T') do set THEDATE=%%c%%b%%a
for /f "tokens=1* delims=: " %%a in ('time /T') do set THETIME=%%aa%%bb%%cc%%dd
ren %1 %~n1%THEDATE%%THETIME%%~x1Echo.> %~f2
For /F "tokens=*" %%A in ('Dir /B /A:-D %~f1') Do Echo @%%A>> %~f2
If %1.==. ( Echo File missing & GoTo :EOF )
If not exist %1 ( Echo File %1 not found & GoTo :EOF )
If %2.==. ( Echo String missing & GoTo :EOF )
If %3.==. ( Echo Output File missing & GoTo :EOF )
Echo Processing [%~f1]
Echo Adding [%2]
Echo Destination [%~f3]

I have a similiar problem with Win 2000 and a dos based program that has to connect through the com 1 port. I found that you can map a com port through Win Terminal Services but I can't find Terminal Services on my 2000. I will try your fix but does anyone know anything about terminal services?

Lucy, I don't think that DOS is hanging, rather it is just waiting for an "End of File" control character (CTRL-z, 026 decimal, 1A hex ) to terminate the transfer and close the file. That's how it used to work in the old real DOS (the O/S as opposed to the CLI that XP gives you) days.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |