The MODE series of commands is used to control the computers links with its peripherals.
- Display lines and columns
- Display configuration
- Printer configuration
- Serial port configuration
- Device status
- Redirect printing from parallel to serial port
- Set typematic rate
- Set code page (character set) for international use
Sets the number of lines and columns (characters/line) of the display.
Syntax:
MODE CON[:] [COLS=c] [LINES=n]
c | The number of characters per line. c can be 40 or 80 (Default: 80). |
n | The 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
Selects or reconfigures the active display adapter and its display mode.
Syntax:
MODE [display][,n]
display | The 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. |
MONO | A monochrome adaptor (with 80 characters per line). |
n | The number of lines displayed on the screen. n can be 25, 43, or 50. Default: 25. |
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 n | The parallel port to which the device is attached. n is 1, 2, 3, or 4 |
COLS=c | The number of characters (columns) per line. c is 80 or 132 - Default: 80. |
LINES=l | The 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: |
b | Return "busy" from a status check of a busy port. |
e | Return an error from a status check of a busy port. |
p | Continue retrying until printer accepts output. |
r | Return "ready" from a status check of a busy port. |
n | Take no retry action (default value). |
Note:
If the COLS, LINES, or RETRY parameters are omitted, the previous values are retained.
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]
COMm | The serial (Com) port. m is from 1 to 4. |
BAUD=b | The first two digits of the transmission rate [bits/sec]: |
12 | 1200 baud | 24 | 2400 baud |
48 | 4800 baud | 96 | 9600 baud |
19 | 19200 baud (not supported on all computers) |
PARITY=p | Specifies how the system uses the parity bit to check for transmission errors. p may be: |
N | None | M | Mark |
E | Even (Default) | S | Space |
O | Odd | | |
DATA=d | Specifies the number of data bits per character. d can be from 5 to 8 (default: 7) |
STOP=s | Specifies the number of stop bits that define the end of a character. s can be 1, 1.5, or 2 (Default: 1) |
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: |
b | Return "busy" from a status check of a busy port. |
e | Return an error from a status check of a busy port. |
p | Continue retrying until printer accepts output. |
r | Return "ready" from a status check of a busy port. |
n | Take no retry action (default value). |
Displays the status of one or all of the devices installed on the system.
Syntax:
MODE [device] [/STATUS]
device | The name of the device. Default: all installed devices. |
/STATUS | This 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>_
|
Redirects output from a parallel port to a serial port.
Syntax:
MODE LPT n = COM m
LPT n | The parallel port (n can be from 1 to 4) |
COM m | The 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
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]
r | The 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. |
d | The 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.
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
device | The device to which the Code Page refers. Valid names for device are: CON, LPT1, LPT2, LPT3, and PRN. |
nnn | The number of the Code Page (character set ). |
filename | The 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 English | 437 | Multilingual (Latin 1) | 850 |
Canadian French | 865 | Slavic (Latin 2) | 852 |
Portuguese | 860 | Nordic | 865 |
File Details
File Name | Default Location | Dos Ver. | Win Ver. | Size | Date | Source |
Mode.com | c:\windows\command |
7.0 | Win95 |
29 191 | 11/07/95 | win95_08.cab |
7.1 | Win95 (OSR2.x) |
29 2711 | 24/08/96 | win95_13.cab |
Win98 |
29 2711 | 11/05/98 | win98_28.cab |
Win98 SE |
29 2711 | 23/04/99 | win98_25.cab |
Superscripts denote which same size files, if any, are identical (using FC).
|