Running Nonnative Applications in Windows 2000 Professional

The OS/2 subsystem handles initialization compatibly with native OS/2 and is configurable using some OS/2 configuration commands. Windows 2000 provides APIs with the prefix Win for this purpose.

Initialization of the Subsystem

When the OS/2 subsystem starts for the first time, it proceeds as follows:

  1. It checks the registry for OS/2 subsystem configuration information.

  2. If it finds none, it checks the original Config.sys file and adds that information to the registry.

  3. If the original Config.sys file does not exist or is not an OS/2 configuration file, the subsystem adds the following default information to the registry:

PROTSHELL=c:\os2\pmshell.exe c:\os2\os2.ini c:\os2\os2sys.ini


SET COMSPEC=%systemroot%\System32\cmd.exe

  1. The subsystem updates the environment variable Os2LibPath with path information found in the original Config.sys file. The updated value of Os2LibPath is SystemRoot \System32\os2\dll, which is concatenated with the list of directories specified in the libpath line of the original Config.sys file.

Path information in the original Config.sys file is not entered automatically into the default Windows 2000 path. To enter this path information, use the following procedure.

To enter Config.sys path information into the default Windows 2000 path

  1. Click Start , and then select Settings .

  2. Click Control Panel .

  3. Click the System icon to open it.

  4. In the dialog box that appears, click the Advanced tab.

  5. Click Environment Variables .

  6. In the System Variables list, double click Os2LibPath .

  7. In the Variable Value window that opens, type SystemRoot \System32\os2\dll.

  8. Click OK .

The system appends this information each time a user logs on.

Changing Registry Information

The OS/2 configuration information is stored in the registry, but you can edit it as an OS/2 Config.sys file with an OS/2 text editor. The seven OS/2 configuration commands that are available for editing are discussed in the next subsection.



To change configuration information, you must be logged on as an administrator.

To change configuration information

  1. While running Windows 2000, start an OS/2 text editor in a window.

  2. Open C:\Config.sys.

  3. Edit the configuration information.

  4. Save and close the file.

  5. Quit the editor.

  6. Log off Windows 2000, and then restart your computer.
    Windows 2000 retrieves the configuration information from the registry and stores it in a temporary file that you can edit. The new information is stored in the registry.

Available Commands for OS/2 Configuration

Windows 2000 supports only the OS/2 configuration commands shown in the following list:

  • codepage

  • country/region

  • devicename

  • devinfo= kbd

  • libpath

  • protshell

  • set

Some of the commands in this list are processed in special ways, as shown in Table B.10.

Table B.10 Processing of OS/2 Configuration Commands


Special Processing


The device driver specified must be compatible with Windows 2000. The syntax is as follows:
devicename = os2devicename [[path][ntdevicename]]
where the variables have the following meanings:
os2devicename : Is the logical name that OS/2-based applications use to address the device.
path and ntdevicename : Specify the Windows 2000 device driver to which the OS/2 device name is to be mapped. If these are omitted, the device is mapped to:
\device\ os2devicename .


This command appends path information to the OS/2 library path in the Windows 2000 environment. You can use it to add or change the path information in the Os2LibPath variable.


Specifies the command interpreter. However, only the Windows 2000 command interpreter, Cmd.exe, is supported.


This command is ignored if used with any of these parameters: COMSPEC, PATH, PROMPT, VIDEO_DEVICES, VIO_IBMVGA, or VIO_VGA.