Programming Field

AUX, COMn (serial port) - DOS/Command Prompt Reference

‘COMn’ is a kind of device file name, referring to serial ports. n is a number such as 1, 2, etc. and COMn would be ‘COM1’, ‘COM2’, ..., and ‘COM9’.

‘AUX’ also refers to serial port, and is treated as same as ‘COM1’.

As an example, serial ports are used to communicate with modems.

Samples

Sample 1

type modemcmd.txt > COM2

Reads the content of ‘modemcmd.txt’ by using Type command and outputs (sends) to COM2.

Sample 2

type COM3

Receives data from COM3 and outputs them to the screen (console). You can use device files as a normal file, so you can read data from COM3 by using Type command. (In most cases combination of Copy command and CON will not output data until data reception is complete.)