MODE
Home >>
MS-DOS Reference >>
Command Categories >>
Environment Commands >>
MODE
Description
Sets a number of options relating to the computer, printer and other devices
Command Syntax
This is one of the most complex commands. It does all of the following:
-
Changes the active code page
-
Configures the printer
-
Configures serial ports
-
Displays info on various devices
-
Configures the display
-
Configures the keyboard repeat rate and delay
-
Redirects the printer
Changing Codepage
To prepare a codepage for a particular device:
MODE device codepage prepare=((yyy )filename)
To select a codepage and make it active
MODE device codepage select=yyy
To restore a previously selected codepage
MODE device codepage refresh
To display information on the current codepage status for a particular
device:
MODE device codepage [/stat[us]]
-
device can be CON (the screen & keyboard), PRN (the printer),
LPT1 (Parallel port #1), LPT2 (Parallel port #2) or LPT3 (Parallel
port #3)
-
yyy is the codepage number. This can be 437 (US English), 850 (multilingual),
860 (Portugese), 863 (French Canadian) or 865 (Nordic)
-
filename is the name of the file containing code page info. This
can be as follows:
| Device |
Codepage file |
| EGA/VGA graphics adaptor |
EGA.CPI |
| IBM PC Convertible LCD display |
LCD.CPI |
| IBM 4201 Proprinter family |
4201.CPI |
| IBM Proprinter X24 and XL24 |
4208.CPI |
| IBM Quietwriter III |
5202.CPI |
You may have other CPI files available; see your DOS documentation for
details
Configuring Printer
MODE LPTn[:][c][,[l][,p]]
or
MODE LPTn[:] [cols=c] [lines=l] [retry=r]
-
n is the parallel port number to which the printer is attached
-
c specifies the number of characters per line (columns) to print.
This can be either 80 or 132
-
l specifies the number of lines per inch to print. This can be either
6 or 8
-
p (DOS 3.3 and earlier) causes DOS to continually retry sending output
when the printer is not ready
-
r (DOS 4+) specifies the action DOS should take if the printer is
not ready. This can be either e (return error), b (return busy), r (return
ready), or none (to take no action)
Configuring Serial Port
MODE COMn[:]b[[,p[,d][,s[,p]]]]
or (DOS 4+)
MODE COMn[:] [baud=b] [parity=p] [data=d]
[stop=s] [retry=r]
-
n is the serial port number (from 1 to 4)
-
b is the baud rate. It can be 110, 150, 300, 600, 1200, 2400, 4800,
9600 or 19200.
-
p specifies the parity (error checking). It can be n (none), o (odd),
or e (even). DOS 4+ also includes m (mark) or s (space)
-
d is the number of data bits. It can be 7 or 8; also 5 or 6 in DOS
4+
-
s is the number of stop bits. This can be 1 or 2, or also 1.5 in
DOS 4+
-
p (DOS 3.3 and earlier) causes DOS to continually retry sending output
when the serial port is not ready
-
r (DOS 4+) specifies the action DOS should take if the serial port
is not ready. This can be either e (return error), b (return busy), r (return
ready), or none (to take no action)
Device Status
MODE [device] [/sta[tus]]
-
device is the name of the device for which you want status info.
If you miss this out, DOS lists all devices.
-
/sta[tus] is not necessary unless you want the status of a redirected parallel
port
Configuring Display
MODE [adaptor][,n]
or
MODE CON[:] [col=c] [lines=n]
To select a display and shift the image with CGA graphics
MODE [adaptor][, shift[,t]]
-
adaptor can be one of the following:
| Display type |
adaptor parameter |
| Monochrome |
mono |
| Colour/graphics 40 column |
40 |
| Colour/graphics 80 column |
80 |
| Colour/graphics 40 column, colour disabled |
bw40 |
| Colour/graphics 80 column, colour disabled |
bw80 |
| Colour/graphics 40 column, colour enabled |
co40 |
| Colour/graphics 80 column, colour enabled |
co80 |
-
n specifies the number of lines on the display. This can be 25,
43 (EGA) or 50 (VGA). (DOS 4+)
-
c specifies the number of columns on the display. This can be either
40 or 80
-
shift specifies the amount by which to shift the display to the
left or right (CGA only). This can be a number up to 40 and must end with
l (to shift ro the left) or r (to shift to the right)
-
t displays a test pattern
Configuring keyboard repeat rate
MODE CON[:] [rate=r delay=d]
-
r is the number of characters per second. This can range from 2
to 32 characters per second
-
d is the delay in quarters of a second. This can be 1, 2, 3, or
4
Redirecting Printer
MODE LPTn[:]=COMm[:]
-
n is the parallel port to redirect from
-
m is the serial port to redirect to.
Comments
Redirecting the printer is usually used when you have a program that can only use the parallel port.
Printed from the NukeSoft MS-DOS Reference. Copyright
© 1995 - 2006 Marcus Houlden