Reading serial port from command line.

777subob

New member
Local time
5:47 PM
Messages
3
Location
Shreveport
Is there a way to read a line of data from the serial port from DOS/NT COMMAND. The only method I've found mentioned in my web searches is the "TYPE" command. But I've not been able to make it work. If I enter "type com1", it seems to begin reading the port, but no matter what control characters I send along with the data, nothing prints to the screen until the buffer is completely full, (I'm guessing...in any case, I have to send a bunch of data before it prints to the screen). And even when it does return data to the screen, it never exits back to the command prompt...just keeps reading the port. Am I missing some parameters or switches? Or is there a better command to use for this?
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell Precision T5500
OS
Windows 7 Professional 64 bit
CPU
Xeon X5660 six core
Memory
6GB
Graphics Card(s)
NVidia Quadro FX 580

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom Bulid/Self made
OS
Windows 11 x64
CPU
i5 2500K @ 3.3 GHz
Motherboard
ASUS P8 Z77 V pro
Memory
16 GB DDR 3 @ 1600Mhz
Graphics Card(s)
MSI 1050TI 4GB OC version
Sound Card
On Board (Realtek HD audio)
Monitor(s) Displays
Samsung 22" LCD
Screen Resolution
1920*1080
Hard Drives
Seagate 1 TB, WD 1TB, Seagate 2 TB ( I use a lot of space)
PSU
coolermaster 750 W
Case
Coolermaster HAF912
Cooling
Coolermaster hyper 212 EVO
Keyboard
Samsung
Mouse
Dell Wireless
Internet Speed
Wireless 50 Mbps
Antivirus
AVG 2016 Internet Security
Browser
Google Chrome
Hi 777subob,

With little searching I have come across this Stackoverflow question and in the question the person uses the copy command to capture output from a serial port. So there is another method, though I don't think using copy will be any better of an option.

Note: COPY COM1 CON is the same as TYPE COM1

When done capturing data, to stop the copy/type command from endlessly attempting to receive further output from the serial port, the device on the over end should send a Ctrl Z control character. (It's Unicode codepoint integer value being 26.) This stops either command from running and returns to the interactive prompt. You can manually press Ctrl Z.


No parameter or switch is missing. There are no built-in/'better' commands readily available that address this task; there is no easy way to read data from a serial port via the command prompt.
 

My Computer

Computer type
PC/Desktop
OS
Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
Back
Top