Mode

Index

The MODE series of commands is used to control the computers links with its peripherals.

  1. Display lines and columns
  2. Display configuration
  3. Printer configuration
  4. Serial port configuration
  5. Device status
  6. Redirect printing from parallel to serial port
  7. Set typematic rate
  8. Set code page (character set) for international use


1. Mode - Display (Lines and Columns):

Sets the number of lines and columns (characters/line) of the display.

Syntax:

MODE CON[:] [COLS=c] [LINES=n]

cThe number of characters per line. c can be 40 or 80 (Default: 80).
nThe number of lines displayed on the screen. n can be 25, 43, or 50 (Default: 25).

Example

To increase the number of lines displayed on the screen from 25 (default) to 50:
MODE CON Lines=50


2. Mode - Display Configuration:

Selects or reconfigures the active display adapter and its display mode.

Syntax:

MODE [display][,n]

displayThe type of display adaptor - one of the following:
BW40
BW80
A colour adaptor with colour turned off and 40 characters/line.
A colour adaptor with colour turned off and 80 characters/line.
CO40
CO80
A colour adaptor with colour turned on and 40 characters/line.
A colour adaptor with colour turned on and 80 characters/line.
MONOA monochrome adaptor (with 80 characters per line).
nThe number of lines displayed on the screen. n can be 25, 43, or 50. Default: 25.


3. Mode: Printer configuration:

This aspect of MODE is used to specify the parallel port (LPT1, LPT2, LPT3 or LPT4) to be used by an IBM/Epson compatible printer. By default, Dos output to a printer is 80 characters/line and 6 lines/inch. MODE can be used to specify 132 characters/inch and/or 8 lines/inch as long as the printer supports these features (and virtually all do - either having a wide carriage or by printing in "condensed" mode)

Syntax:

MODE LPT n[:] [COLS=c] [LINES=l] [RETRY=r]
or
MODE LPT n [c], [l], [r]

LPT nThe parallel port to which the device is attached. n is 1, 2, 3, or 4
COLS=cThe number of characters (columns) per line. c is 80 or 132 - Default: 80.
LINES=lThe number of lines per inch. l is 6 or 8 - Default: 6.
RETRY=r the retry action to take if a time-out error occurs when sending output to the specified port. This parameter causes part of MODE to remain resident in memory. r may be:
bReturn "busy" from a status check of a busy port.
eReturn an error from a status check of a busy port.
pContinue retrying until printer accepts output.
rReturn "ready" from a status check of a busy port.
nTake no retry action (default value).

Note:

If the COLS, LINES, or RETRY parameters are omitted, the previous values are retained.


4. Mode: Serial Port Configuration:

Sets the parameters for a serial port.

Syntax:

MODE COMm[:] [BAUD=b] [PARITY=p] [DATA=d] [STOP=s] [RETRY=r]
or
MODE COMm[:] [b], [p], [d], [s], [r]

COMmThe serial (Com) port. m is from 1 to 4.
BAUD=bThe first two digits of the transmission rate [bits/sec]:
121200 baud242400 baud
484800 baud969600 baud
1919200 baud (not supported on all computers)
PARITY=pSpecifies how the system uses the parity bit to check for transmission errors. p may be:
NNoneMMark
EEven (Default)SSpace
OOdd
DATA=dSpecifies the number of data bits per character. d can be from 5 to 8 (default: 7)
STOP=sSpecifies the number of stop bits that define the end of a character. s can be 1, 1.5, or 2 (Default: 1)
RETRY=rthe retry action to take if a time-out error occurs when sending output to the specified port. This parameter causes part of MODE to remain resident in memory. r may be:
bReturn "busy" from a status check of a busy port.
eReturn an error from a status check of a busy port.
pContinue retrying until printer accepts output.
rReturn "ready" from a status check of a busy port.
nTake no retry action (default value).


5. Mode - Device Status:

Displays the status of one or all of the devices installed on the system.

Syntax:

MODE [device] [/STATUS]
deviceThe name of the device. Default: all installed devices.
/STATUSThis switch includes the status of any redirected parallel printers.
Without this switch, the status of all installed devices except redirected parallel printers is displayed.

Example


C:\WINDOWS>MODE /status

Status for device LPT1:
LPT1: not rerouted
Retry=NONE
Code page operation not supported on this device

Status for device LPT2:
LPT2: not rerouted
Retry=NONE
Code page operation not supported on this device

Status for device LPT3:
LPT3: not rerouted

Status for device CON:
Columns=80
Lines=50

No code page has been selected
Prepared code pages:
  code page 850
  code page not prepared
MODE status code page function completed

Status for device COM1:
Retry=NONE

Status for device COM2:
Retry=NONE

Status for device COM3:
Retry=NONE
Return code (ERRORLEVEL):   0

C:\WINDOWS>_
 


6. Mode - Redirect printing:

Redirects output from a parallel port to a serial port.

Syntax:

MODE LPT n = COM m
LPT nThe parallel port (n can be from 1 to 4)
COM mThe serial port (m can be 1 to 4)

Notes:

To set up a system so that it sends parallel-printer output to a serial printer, the MODE command must be used twice: once to configure the serial port and the second time to redirect output to the serial port specified in the first MODE command.

To return to the standard form of output, use MODE to configure the parallel port in the usual way - ie.
MODE LPTn


7. Mode - Typematic rate:

When a character key on the keyboard is pressed, the character is immediately displayed on the monitor. If the key is held down, after a short interval, the character is repeated until the key is released.
Typematic rate has two components: the "rate" at which the character is repeated, and the "delay" which is the interval between pressing a key and the characters repeating.

Syntax:

MODE CON [RATE=r DELAY=d]
rThe rate at which a character is repeated. r can be from 1 to 32 (equivalent to 2 to 30 characters per second) with a default of 21.
dThe delay before characters are repeated. d can be 1 to 4 (equivalent to 0.25 to 1 second respectively) with a default of 2 (0.5 seconds).

Notes:

Both parameters must be included.

Some keyboards do not recognize this command.


8. Mode - Set Device Code Pages:

This aspect of the MODE command is used when working with code pages (or character sets) for printers, keyboards, and monitors. Alternative character sets are typically used when working with any "non US English" language.

Syntax:

To "prepare" a code page for use with a device:
MODE device CP PREPARE=nnn [...] filename

To select a prepared code page for use with a device:
MODE device CP SELECT=nnn

To refresh a prepared code page that has become corrupted or been lost through some hardware error:
MODE device CP REFRESH

To display the numbers of the current character sets prepared and/or selected for device:
MODE device CP
deviceThe device to which the Code Page refers. Valid names for device are: CON, LPT1, LPT2, LPT3, and PRN.
nnnThe number of the Code Page (character set ).
filenameThe file containing the Code Page Information.

Notes:

A Code Page must be "prepared" before it can be selected.

There are Code Pages for character sets in use in just about every country in the world. Many of the more widely used are built into Windows, and others can be added as required.
Examples include:

United States English437Multilingual (Latin 1)850
Canadian French865Slavic (Latin 2)852
Portuguese860Nordic865


File Details

File NameDefault LocationDos Ver.Win Ver.SizeDateSource
Mode.comc:\windows\command 7.0Win95 29 19111/07/95win95_08.cab
7.1Win95 (OSR2.x) 29 271124/08/96win95_13.cab
Win98 29 271111/05/98win98_28.cab
Win98 SE 29 271123/04/99win98_25.cab

Superscripts denote which same size files, if any, are identical (using FC).


If you should have any comments or suggestions,
please contact: Bob Watson
.
This page last revised:
August 28, 2000.