Running Nonnative Applications in Windows 2000 Professional

You can customize the environment for MS-DOS-based applications using PIF files.

Customizing Program Information

When you start an MS-DOS-based application, Windows 2000 looks for a PIF file. If you were using a PIF file to run an MS-DOS-based application on Windows 3. x , you can continue to use it. In Windows 2000, however, a PIF file is created only when you create or modify a shortcut for the application.

To create, modify, and save a PIF file

  1. Right-click the application file name in Windows Explorer.

  2. Click Properties .

  3. In the applications Properties dialog box, modify any settings you want to be different.

  4. Click OK to save the new settings in a shortcut (PIF) file for the application.

The file name and extension of the new file are Xxx .pif, where xxx represents the main program file of the application. You can change the file name, but do not change the extension.

The extension is not shown on Windows 2000 except in command-line tools like the dir command. However, you can still see a listing of your PIF files if you search for them using that extension. For example, the right pane of the window in Figure B.3 illustrates the results of a search for files in the format *.pif.

Cc939073.fnic12(en-us,TechNet.10).gif

Figure B.3 Results of a Search for Files with a *.pif Extension

Any changes made to the applications properties are also written to its PIF files properties.

note-icon

Note

The system reads a PIF file whenever you start the application by double-clicking its icon or the PIF files icon. If you start the application from the command line, PIF file settings are ignored.

Using Multiple PIF Files for an Application

You can create more than one PIF file for an application, and you can create several PIF files for running an application under different circumstances.

For example, on the Memory tab of a PIF file you can specify how much expanded memory specification (EMS) an application has access to. If you have two PIF files, you can allot a large amount of EMS to one of them for working with large data files, and allot only limited EMS to the other for use with small files.

For information about how to set up two PIF files for an application, see Windows 2000 Professional Help.

Default PIF File

Windows 2000 provides a default file, _default.pif, in the SystemRoot folder. It has settings that work with most MS-DOS-based applications. Windows 2000 uses this PIF file if the application does not have one. Changing the settings in this file is not encouraged; leave the default file intact and create a separate PIF file for the application.

Manufacturer-Supplied PIF Files

Some software manufacturers provide a PIF file for an application. To find out whether your application has one, search the disks for a file with a .pif extension. For more information, see Windows 2000 Professional Help.

Customizing Startup in the MS-DOS Environment

To create a custom startup file for your application in Windows 2000, first specify this file in the applications PIF file. When you start the application, Windows 2000 reads the custom file rather than the Config.nt and Autoexec.nt files. For example, if your application requires a TSR program when it runs, you can include the name of that program in the applications startup file.

tip-icon

Tip

When you create startup files, base them on the Autoexec.nt and Config.nt files. That way the basic information to configure the MS-DOS environment is already included.

At system startup, Windows 2000 adds path and set commands from the C:\Autoexec.bat file to the Windows 2000 environment variables, then ignores the remainder of both C:\Autoexec.bat and C:\Config.sys. If these files are not present when you install Windows 2000, the Setup program creates them.

The startup files in this environment subsystem, and their use by Windows 2000, are listed in Table B.4.

Table B.4 Startup Files in the MS-DOS Environment

File

Use in Windows 2000

C:\Autoexec.bat

Adds path and environment variables to the Windows 2000 environment at system startup. The values thus established for these variables are then available to each application you use.

C:\Config.sys

Is not used by Windows 2000.

Autoexec.nt and Config.nt in SystemRoot \System32

Configures the environment when an MS-DOS-based application is started with _default.pif. (You can use custom .nt files if you start from another PIF file.)

You can edit the Config.nt and Autoexec.nt files just as you would Config.sys and Autoexec.bat. If you change values in Autoexec.bat, Autoexec.nt, or Config.nt, you must restart to make the changes effective.

Available Commands for MS-DOS Configuration

When you start an application in a new command window, Windows 2000 reads the Config.nt and Autoexec.nt files to configure the environment. If, for example, you change a driver in the applications Config.nt file, the change goes into effect the next time you start the application. Most commands in these files, but not all, are available for this purpose.

Config.nt File

Windows 2000 ignores any commands in the Config.nt file except for those listed in Table B.5. Also listed are special uses for these commands, if any.

Table B.5 Commands in Config.nt File That are Read by Windows 2000

Command

Special Use

country/region

No special use.

device

Loads an installable device driver. If necessary, you can load drivers that control memory, such as Himem.sys, or that control character-based display, such as Ansi.sys.

dos

No special use.

dosonly

No special use.

echoconfig

No special use.

fcbs

No special use.

files

No special use.

install

No special use.

loadhigh

No special use.

ntcmdprompt

Runs the Windows 2000 command interpreter, Cmd.exe, rather than Command.com after running a TSR program or after starting the command prompt from within an MS-DOS-based application.

rem

No special use.

shell

Specifies the command interpreter. Only Cmd.exe is supported.

stacks

No special use.

Autoexec.nt File

Windows 2000 supports approximately the same range of commands in the Autoexec.nt file as MS-DOS does in the Autoexec.bat file. For more information about these configuration commands, see Windows 2000 Professional Help.