Logo
PREGNANCY
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
 
 
Windows Server

Windows Server 2008 Server Core : Starting the Command Interpreter (part 3) - Modifying AutoExec.NT & Defining Application Compatibility with the SetVer Utility

3/20/2012 5:35:44 PM

3. 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.

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.

3.1. 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 character-mode 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 PageCountry or Language
437United States
850Multilingual (Latin I)
852Slavic (Latin II)
855Cyrillic (Russian)
857Turkish
860Portuguese
861Icelandic
863Canadian-French
865Nordic
866Russian
869Modern Greek
874Thai
932Japanese Shift-JIS
936Simplified Chinese GBK
949Korean
950Traditional Chinese Big5
1258Vietnam

3.2. 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. 

3.3. Enabling Graphics Character Support with the Graf Tabl 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 5.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.

3.4. 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.

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.

3.5. Saving Memory Using the LH Command

The Load High (LH) command attempts to load a utility into high memory, instead of using application memory. Loading the utility high saves memory that memory-hungry applications can use to load. Generally, you should try to load high all of the utilities that you can, including DosX and ReDir. Windows 64-bit editions don't support this command. This command uses the following syntax:

LH

You don't need to provide any command line switches with this command. Simply add the command or utility that you want to load high after LH on the command line. The system won't display an error message if the command fails. However, you can verify the utility's location in memory using the Mem utility.

3.6. Adding CD Support with MSCDexNT Utility

Windows provides all of the CD and DVD support that you need. The name of this support under DOS is Microsoft Compact Disk (or CD-ROM) Extensions (MSCDEX). However, you still need access to this support from the command prompt. Loading the MSCDexNT utility loads several additional applications including VCDEX.DLL, which is the 32-bit MSCDEX Virtual Device Driver. This utility uses the following syntax:

MSCDexNT

You don't need to supply any command line switches when using this utility.

3.7. Installing the Network Redirector Using the Re Dir Utility

Use this utility to load the VDM Virtual Device Driver (VDD) redirector. The redirector provides virtual device access from the command prompt. Essentially, it provides network access. This utility uses the following syntax:

ReDir

You don't need to supply any command line switches when using this utility.

Server Core and the PIF

The Program Information File (PIF) is an addition to a DOS application that controls how Windows interacts with the application. You don't start the application using the PIF (although double-clicking the PIF will start the application), but the PIF always affects how Windows works with the application. From a command line perspective, you can use a PIF to perform two special tasks. First, you can create custom AutoExec.NT and Config.NT for the application so you can control the application environment. Second, you can add command line switches to the application command line so that the application starts with the features you want to use.

When working with a graphical version of Windows, you simply right-click the DOS application you want to modify and choose Properties from the context menu. This act actually creates the PIF. Unfortunately, Server Core lacks Windows Explorer, which means you don't have access to the usual graphical means of creating a PIF. At one time, Microsoft also provided the PIFEdit utility. However, this utility disappeared with Windows NT because users found it too difficult to use and there isn't a place to download this utility any longer online . Consequently, if you want to work with PIF files in Server Core, you'll have to perform the task at the client machine using the same techniques you've always employed.


4. Defining Application Compatibility with the SetVer Utility

Some older applications expect a specific version of DOS (the command interpreter) when they execute and won't execute with any other version. Usually, these applications won't even start; they simply display an error message telling you to get the right version of DOS. You can overcome this particular problem by adding an entry for the application to the Set Version (SetVer) utility table. When you try to execute the application, the command interpreter tells it that it's executing with the specific version of DOS that the application needs. This utility uses the following syntax:

Display the SetVer Information
      SETVER [drive:path]
Add a New Application
      SETVER [drive:path] filename n.nn
Delete an Application
      SETVER [drive:path] filename /DELETE [/QUIET]

The following list describes each of the command line arguments.


[drive:path]

Specifies the location of the SetVer.EXE file.


filename

Specifies the name of the program to add to or delete from the SetVer table.


n.nn

Specifies the DOS version to report to the application.


/DELETE or /D

Deletes the application listing from the SetVer table.


/QUIET

Performs the specified task without displaying any prompts. Use this option when working with batch files to prevent the utility from interrupting the user.

NOTE

You must load SetVer.EXE as a device driver in Config.NT to obtain the version-setting feature that it provides. You can check the SetVer status at the command prompt by typing SetVer and pressing Enter. The command displays a list of applications that appear in the SetVer table, and then displays the SetVer status. You'll see an error message when the device isn't loaded into memory.

Other -----------------
- Windows Server 2008 Server Core : Essential Registry Hacks - Modifying the Software Setup
- Sharepoint 2007 : Customizing a SharePoint Site - Create a Content Type
- Sharepoint 2007 : Modify the Top or Left Navigation Bar & Create a Site Column
- Microsoft Systems Management Server 2003 : Configuring Site Server Properties and Site Systems - Monitoring Status and Flow
- Microsoft Systems Management Server 2003 : Configuring Site Server Properties and Site Systems - The Site Configuration Process Flow
- Windows Server 2003 : Windows Security and Patch Management - Using Auditing and the Event Log
- Windows Server 2003 : Windows Security and Patch Management - Locking Down Windows
- Recovering from a Disaster in an Exchange Server 2007 Environment : Recovering from a Site Failure & Recovering from a Disk Failure
- Recovering from a Disaster in an Exchange Server 2007 Environment : Identifying the Extent of the Problem & Preparing for a More Easily Recoverable Environment
- Windows Server 2008 Server Core : Setting the Environment & Modifying the Hardware Setup
- Windows Server 2008 Server Core : Performing Console Configuration
- Windows Server 2008 : Using Basic ds Commands - Understanding Distinguished Names & Adding Objects with dsadd
- Windows Server 2008 : Manipulating IIS with appcmd
- Microsoft Lync Server 2010 Edge : Edge Server Administration (part 2)
- Microsoft Lync Server 2010 Edge : Edge Server Administration (part 1)
- Sharepoint 2010 : Setting Up the Crawler - Crawling Other Document Types with iFilters
- Sharepoint 2010 : Setting Up the Crawler - Defining Scopes
- Microsoft Dynamics CRM 4.0 Accelerators : Extended Sales Forecasting Accelerator (part 1) - CRM Reports
- Microsoft Dynamics CRM 4.0 Accelerators : Extended Sales Forecasting Accelerator (part 1) - CRM Customizations
- Microsoft Dynamics AX 2009 : Processing Business Tasks - Building a Display dimensions dialog
 
 
Most view of day
- Windows Server : Network Access Policy and Server and Domain Isolation (part 2) - Planning NAP IPsec Enforcement
- Planning Deployment : Installing BDD 2007
- Microsoft Access 2010 : Enhancing the Queries That You Build - Everything You Need to Know About Query Basics
- System Center Configuration Manager 2007 : Desired Configuration Management - Troubleshooting
- Sharepoint 2013 : Working with the CSOM (part 1) - Understanding client object model fundamentals
- Microsoft SharePoint 2013 : Working with Visio Services - Designing dashboards - Data linking (part 1) - Obtaining external data
- Securing Your SharePoint and Windows Azure Solutions : Configuring Shared Access Permissions for BLOB Storage - Using the Service Bus and Access Control Service
- Integrating BizTalk Server 2010 and Microsoft Dynamics CRM : Communicating from Dynamics CRM to BizTalk Server (part 3) - Registering the plugin, Testing the plugin
- Microsoft Exchange Server 2010 : Managing Transport and Journaling Rules - Setting Up Message Classifications (part 1)
- Windows Phone 8 : Phone-Specific Design (part 2) - Using the Panorama Control in Blend
Top 10
- Sharepoint 2013 : Working with the CSOM (part 6) - Working with the JavaScript client object model - Creating, reading, updating, and deleting in the JavaScript client object model
- Sharepoint 2013 : Working with the CSOM (part 5) - Working with the JavaScript client object model - Handling errors
- Sharepoint 2013 : Working with the CSOM (part 4) - Working with the JavaScript client object model - Returning collections
- Sharepoint 2013 : Working with the CSOM (part 3) - Working with the managed client object model - Creating, reading, updating, and deleting
- Sharepoint 2013 : Working with the CSOM (part 2) - Working with the managed client object model - Handling errors
- Sharepoint 2013 : Working with the CSOM (part 1) - Understanding client object model fundamentals
- Windows Phone 8 : Configuring Mailbox Settings (part 5) - Configuring Automatic Replies
- Windows Phone 8 : Configuring Mailbox Settings (part 4) - Lightening the Display,Changing the Mailbox Sync Settings
- Windows Phone 8 : Configuring Mailbox Settings (part 3) - Message Signatures, Blind CCing Yourself
- Windows Phone 8 : Configuring Mailbox Settings (part 2) - Unlinking Mailboxes, Conversation View
 
 
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
2015 Camaro