Windows 7 / Getting Started

Modifying AutoExec.NT

Although Config.NT offers some interesting low-level methods of changing the command line environment, the AutoExec.NT file provides far more opportunities. Any application that you can access from the command line is also a candidate for inclusion in the AutoExec.NT file. Adding applications that you always use can set up the command line from the outset, so you see what you need without entering any commands at all. You can also program the AutoExec.NT file as you would any other batch file. This means you can add menus to your setup so you can choose the options you want to see. See the "Creating Batch Files" section of the tutorial for details on creating a programmed interface to your AutoExec.NT file. The sections that follow describe some utilities that you'll use most often from within the AutoExec.NT file. These utilities tend to configure the command environment, in some way, to make your computing experience better. However, don't limit yourself to these selections-any command or utility.

NOTE: You'll find some older utilities that Windows installs for compatibility purposes and then doesn't support. The KB16 utility should provide keyboard support, but you'll find that the command line provides this support automatically, so you don't actually need to use the KB16 utility. Even though the KB16 utility loads into memory and appears to perform a task, it doesn't do anything. In addition to the KB16 utility, you'll find that Windows doesn't support the MSCDex utility. This tutorial doesn't discuss these compatibility commands and utilities.

Setting the Code Page Number with the CHCP Utility

A code page defines language support at the command prompt. In the days of DOS, you needed to provide a code page to obtain proper language support at the command prompt, but Windows doesn't usually require you to set a code page. You might need to set a code page for older charactermode applications. Only the OEM font you installed as part of Windows displays properly when you use a raster font in a windowed command prompt. However, you can use any of the supported code pages in full screen mode or with a TrueType font. This utility uses the following syntax:

CHCP [nnn]

The following describes the command line argument.

nnn Defines the code page to use. The standard code page numbers appear in Table-1. Code pages 874 through 1258 are both OEM and ANSI implementations that are only available in Windows. You can install additional code pages as needed. The Web site at http://www.i18nguy.com/unicode/codepages.html#msftdos shows how these code pages appear.

Table-1: Standard OEM and OEM/ANSI Code Pages
Code Page 	Country or Language
437 		United States
850 		Multilingual (Latin I)
852 		Slavic (Latin II)
855 		Cyrillic (Russian)
857 		Turkish
860 		Portuguese
861 		Icelandic
863 		Canadian-French
865 		Nordic
866 		Russian
869 		Modern Greek
874 		Thai
932 		Japanese Shift-JIS
936 		Simplified Chinese GBK
949 		Korean
950 		Traditional Chinese Big5
1258 		Vietnam

Adding DPMI Support Using the DosX Utility

The DOS Protected Mode Interface (DPMI) is one method for a DOS application to access more than the 640 KB that DOS (the command line) typically allows. In addition, this interface provides protected memory access, so the DOS application doesn't interfere with Windows operation. You can read about DPMI at http://whatis.techtarget.com/definition/0,,sid9_gci213913,00.html. To use this interface, an application developer needs to provide special support in the application; usually as part of a third-party add-on library. All you need to know is whether the application (typically a game) supports DPMI to use this feature. This utility uses the following syntax:

DosX

As you can see, this utility doesn't require any command line switches and it doesn't display any messages after you install it.

Enabling Graphics Character Support with the GrafTabl Utility

Normally, the system displays any extended characters your application needs to display as plaintext. In some cases, this means the extended characters won't display correctly because your system may lack the capability required to display the extended characters properly. The GrafTabl utility helps Windows display extended characters as graphics, which means they always display correctly as long as you have the proper code page support loaded. The GrafTabl utility only affects extended character display; you need to use the Mode or CHCP utilities to change the console input. This utility uses the following syntax:

GRAFTABL [xxx]
GRAFTABL /STATUS

The following list describes each of the command line arguments.

xxx Specifies the code page number to use for display purposes. Table-1 lists the common code pages for Windows.

/STATUS Displays the code page that the GrafTabl has loaded for display purposes. This command line switch doesn't reflect the Mode or CHCP utility settings.

NOTE: The GrafTabl utility won't work with Windows Itanium or Windows 64-bit versions.

Printing Command Line Graphics with the Graphics Utility

Server Core isn't supposed to do anything when you try to use the Graphics utility, according to the Windows help file. However, the Graphics utility does load and apparently has some functionality. With this in mind, using the Graphics utility is an "at your own risk" kind of utility that you should only try as a last resort to obtain required application functionality. The \WINDOWS\system32 directory contains the GRAPHICS.COM and GRAPHICS.PRO files mentioned in the Knowledge Base article at http://support.microsoft.com/default.aspx?scid=kb;en-us;Q78123.

Warning Using the Graphics utility can produce some unexpected side effects when working at the command prompt. For example, you may find that the command history buffer no longer works. In addition, you might not be able to scroll through the buffer to see older information. The Graphics utility tends to restrict you to a single command mode and only one screen at a time.

Use the Graphics utility to load support for printing graphics at the command line. Some older applications may require this support, but generally, you don't need to load the Graphics utility. For example, you may need to load the graphics utility to print a screenshot of an older game. Press Shift+Print Screen to print a graphics image with this utility loaded. This utility uses the following syntax:

GRAPHICS [type] [[drive:][path]filename] [/R] [/B] [/LCD] [/PRINTBOX:STD | /PRINTBOX:LCD]

The following list describes each of the command line arguments.

type Specifies the printer type. In most cases, you'll want to use the default type unless you experience problems getting the default type to work. The printer types include: COLOR1, COLOR4, COLOR8, HPDEFAULT, DESKJET, GRAPHICS, GRAPHICSWIDE, LASERJET, LASERJETII, PAINTJET, QUIETJET, QUIETJETPLUS, RUGGEDWRITER, RUGGEDWRITERWIDE, THERMAL, and THINKJET.

[drive:][path]filename Specifies a file containing printer support information. You must obtain this file from the printer vendor in most cases.

/R Prints the output as white letters on a black background as normally displayed on screen. Normally, the utility reverses the colors to save ink.

/B Prints the background in color for the COLOR4 and COLOR8 printers.

/LCD Outputs the screen using the Liquid Crystal Display (LCD) aspect ratio so the output looks like the screen.

/PRINTBOX:STD | /PRINTBOX:LCD Displays a print box around the output. The options specify the print box size. You can choose between the standard (STD) or LCD aspect ratios.

[Previous] [Contents] [Next]