Chapter 26 - Initialization Files and the Registry
Archived content. No warranty is made as to technical accuracy. Content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
Although the Registry replaces the initialization (.ini) files used in versions of Microsoft Windows created for MS-DOS, some .ini files still appear in the Windows NT system directory. Also, applications created for 16-bit Microsoft Windows must still be able to read and write .ini values that previously were stored in the Win.ini or System.ini file.
This chapter describes how .ini files and other configuration files are used under Windows NT and how these values are stored in the Registry. The following topics are discussed in this chapter:
How Windows NT uses MS-DOS configuration files
How .ini files are mapped to the Registry
Microsoft OS/2 version 1.x entries in the Registry
POSIX entries in the Registry
Related topics are discussed in documentation forWindows NT version 4.0:
For details about the Shared32.ini file, see Appendix A of the Windows NT* *Server Concepts and Planning.
For details about Registry entries for Microsoft Mail and Microsoft Schedule+ initialization values, see Regentry.hlp, the Registry Help file in the Windows NT Workstation Resource Kit CD.
How Windows NT Uses MS-DOS Configuration Files
During system startup, Windows NT adds any Path, Prompt, and Set commands from the C:\Autoexec.bat file to the Windows NT environment variables and then ignores the rest of the contents of C:\Autoexec.bat and C:\Config.sys. If these files are not present when you install Windows NT, the Setup program creates them. Setup also creates default Autoexec.nt and Config.nt files.
The path and other Windows NT environment information are stored under the following Registry key:
HKEY_LOCAL_MACHINE \System
\CurrentControlSet
\Control
\Session Manager
\Environment
When an MS-DOS-based application is started, Windows NT executes files specified in the application's program information file (PIF) or the Autoexec.nt and Config.nt files in the Systemroot\System32 directory. Any changes made in one of these files take effect as soon as the file is saved and a new MS-DOS-based application is started that uses that file. You do not need to restart your system after changing the .nt files. Windows NT uses these files as follows:
Files |
Use in Windows NT |
---|---|
C:\Autoexec.bat |
Path and environment variables are added to the Windows NT environment at system startup. |
C:\Config.sys |
Not used by Windows NT. |
Autoexec.nt and Config.nt |
Used every time an MS-DOS-based application is run with _Default.pif. (Custom .nt files can be created and used when starting an application from another PIF.) |
You can use any text editor to view the contents of the Autoexec.nt and Config.nt files.
Commands in the Autoexec.bat and Config.sys files for starting applications and initializing drivers are ignored in Windows NT.
To run an application automatically when you start Windows NT, use the Taskbar option on the Start menu to place a shortcut to the application in the Taskbar Startup group. For more information, see Windows NT Start Here.
To run a service or driver automatically, use the Services option in Control Panel: In Control Panel, double-click Services. Select a service from the list, then click the Startup button. In the Startup type field of the Service dialog box, click Automatic, then click OK. This setting is saved as the Start value in the service's subkey under HKEY_LOCAL_MACHINE \System \CurrentControlSet \Services in the Registry.
Windows NT Virtual MS-DOS Machines
In Windows NT, each MS-DOS-based application and 16-bit Windows-based applications run in a Windows NT virtual MS-DOS machine (NTVDM), a single-threaded process that supports 16-bit applications in a 32-bit environment. Windows NT includes the necessary virtual device drivers (VDDs) for the mouse, keyboard, printer, COM ports, and network support. The VDDs are loaded into every VDM based on values stored in the Registry. Information about VDDs is found in the following Registry path:
HKEY_LOCAL_MACHINE \System
\CurrentControlSet
\Control
\VirtualDeviceDrivers
The system manages any changes to the VDD entries automatically when you add a device driver by using Windows NT Setup.
Windows for MS-DOS on Windows NT
In Windows NT, each application written for MS-DOS runs in its own NTVDM process.
Windows NT runs the application by using a NTVDM and VDDs. This process is called WOW, for Win16-on-Win32. Using a 16-bit NTVDM, Windows NT translates Windows 3.1–based application calls in Enhanced mode on all Intel-based and RISC-based computers.
Control parameters for WOW startup and for the WOW application environment are found under the following Registry path:
HKEY_LOCAL_MACHINE \System
\CurrentControlSet
\Control
\WOW
The system maintains the settings in this key automatically. They should not require manual changes.
The environment settings equivalent to the System.ini file for Windows 3.x are found in this Registry path:
HKEY_LOCAL_MACHINE \Software
\Microsoft
\Windows NT
\CurrentVersion
\WOW
The WOW subkeys have the same names as headings in the System.ini file, and the values are the same as items contained in the old System.ini file. For details about these entries, see the online Help for the Registry.
How .ini Files Are Mapped to the Registry
If you install Windows NT as an upgrade to Windows 3.x, all of the settings in the initialization files are copied into the Registry, including settings in Control.ini, Progman.ini, System.ini, Win.ini, and Winfile.ini. You can see where the Windows initialization files are mapped in the Registry by viewing the subkeys and value entries under this path:
HKEY_LOCAL_MACHINE \Software
\Microsoft
\Windows NT
\CurrentVersion
\IniFileMapping
When you install an application created for 16-bit Windows, the application's setup program creates its own .ini file or creates entries for the Win.ini or System.ini file in the same way that it does for any version of Windows 3.x. These entries are not updated in the Registry because these applications do not have a way to access the Windows NT Registry. For this reason, basic System.ini, Win.ini, and Winfile.ini files appear in the Systemroot directory in Windows NT.
If a Windows-based application tries to write to Win.ini, System.ini, or any other section listed in the IniFileMapping key, and if the application uses the Windows NT Registry APIs, the information is stored in the Registry. If the application writes to other sections of the .ini file or tries to open the .ini file directly without using the Windows NT Registry APIs, the information is saved in an .ini file.
To find mapping information in the HKEY_LOCAL_MACHINE \Software key, the system searches for the filename extension of the initialization file. If it finds the filename extension, it looks under the mapped key for the name of the application associated with that file type and a variable name. If necessary, it continues to look for keys whose value entries are the variable names. If no mapping for either the application name or filename is found, the system looks for an .ini file to read and write its contents.
Tables 26.1 through 26.3 show where system settings are saved in the Registry in comparison to initialization files used with Windows 3.1 for MS-DOS.
In the entries in the IniFileMapping key and in Tables 26.1 through 26.3, the following symbols are used:
Symbol |
Description |
---|---|
! |
Forces all writes to go to both the Registry and to the .ini file on disk. |
# |
Causes the Registry value to be set to the value in the Windows 3.1 .ini file whenever a new user logs on for the first time after Setup, if Windows NT was installed on a computer that had Windows 3.1 already installed. |
@ |
Prevents any reads from going to the .ini file on disk if the requested data is not found in the Registry. |
USR |
Stands for HKEY_CURRENT_USER, and the text after the prefix is relative to that subtree. |
SYS |
Stands for HKEY_LOCAL_MACHINE \Software, and the text after the prefix is relative to that key. |
Win.ini Settings in the Registry
The information stored in the keys described in Table 26.1 is used by applications that expect to find this information in a Win.ini file.
Win.ini section |
Registry path |
Description |
---|---|---|
[colors] |
#USR\Control Panel\Colors1 |
Defines colors for the Windows display as set by using the Display option in Control Panel. |
[compatibility] |
#SYS...\Compatibility3 |
— |
[desktop] |
#USR\Control Panel\Desktop1 |
Specifies appearance of the desktop as set by using the Desktop option in Control Panel. |
[embedding] |
#SYS...\Embedding3 |
Lists the server objects used in OLE; created during software setup. |
[extensions] |
#USR...\Extensions2 |
Associates types of files with applications as set by using Options on the View menu of Windows NT Explorer. |
[fonts] and |
#SYS...\Fonts and \FontSubstitutes3 |
Describes the screen font files loaded by Windows as set by using the Fonts option in Control Panel. |
[intl] |
#USR\Control Panel\International1 |
Describes items for languages and locales as set by using the Regional Settings option in Control Panel. |
[mci extensions] |
SYS...\MCI Extensions3 |
Associates file types with Media Control Interface devices as set by using the Drivers option in Control Panel. |
[network] |
USR...\Network\Persistent Connections2; network printers in HKEY_LOCAL_MACHINE |
Describes network printer port settings as set by using the Printers option in Control Panel and the persistent network connections as set by using Windows NT Explorer. |
[ports] |
SYS...\Ports3 |
Lists all available printer and communications ports as set by using the Ports option in Control Panel. |
[printerPorts] and [devices] |
SYS...\PrinterPorts and \Devices3 |
Lists active and inactive output devices to be accessed by Windows as set by using the Printers option in Control Panel. |
[sounds] |
#USR |
Lists the sound files assigned to each system event as set by using the Sound option in Control Panel. |
[TrueType] |
#USR...\TrueType2 |
Describes options for using TrueType fonts as set using the Fonts option in Control Panel. |
[Windows Help] |
USR\Software |
Lists settings for the Help window as set by using the mouse or menus in any Help window. |
[Winlogon] |
#SYS...\Winlogon3 |
Specifies the Windows environment and user startup options as set by using the Desktop, Keyboard, and Mouse options in Control Panel. |
1 Full path = HKEY_CURRENT_USER
2 Full path = HKEY_CURRENT_USER \Software \Microsoft \Windows NT\CurrentVersion
3 Full path = HKEY_LOCAL_MACHINE \Software \Microsoft \Windows NT\CurrentVersion
System.ini Settings in the Registry
Entries from a System.ini file in 16-bit Windows 3.x on the computer when you install Windows NT are preserved as entries under this key:
HKEY_LOCAL_MACHINE \Software
\Microsoft\Windows NT
\CurrentVersion
\WOW
Table 26.2 describes where you can view or edit entries for similar purposes in Windows NT. These entries are used by applications that look for values in the System.ini file.
System.ini section |
Registry path |
Description |
---|---|---|
[boot] and [boot.description] |
#SYS...\WOW\Boot and \Boot.description3; replaced by |
Lists drivers and Windows modules as set by using the System option in Control Panel. |
[drivers] |
Replaced by #SYS...\Drivers323 |
Contains a list of aliases (or names) assigned to installable driver files as set by using the Drivers and Devices options in Control Panel. |
[keyboard] |
#SYS...\WOW\Keyboard3; |
Contains information about the keyboard as set by using the Regional Settings option in Control Panel or as dentified by the Hardware Recognizer. |
[mci] and [mci32] |
Replaced by #SYS...\MCI and \MCI323 and #SYS...\Drivers.desc3 |
Lists Media Control Interface (MCI) drivers as set by using the Drivers option in Control Panel. |
[NonWindows App] |
#SYS...\WOW\NonWindowsApp3 |
Contains information used by non-Windows–based applications as defined in PIFs for specific applications or in Config.nt. |
[standard] |
Standard in #SYS...\WOW3 |
Contains information used by 16-bit Windows 3.x in Standard and 386 enhanced mode. All memory management is handled automatically by Windows NT. |
1 Full path = HKEY_CURRENT_USER
2 Full path = HKEY_CURRENT_USER \Software \Microsoft \Windows NT\CurrentVersion
3 Full path = HKEY_LOCAL_MACHINE \Software \Microsoft\Windows NT\CurrentVersion
Other Initialization File Settings in the Registry
Table 26.3 describes where you can view or edit Registry entries equivalent to Control.ini, Progman.ini, and Winfile.ini entries.
.Ini file section |
Registry path |
Description |
---|---|---|
Control.ini |
Color Schemes, Current, and Custom Colors subkeys in |
Describes color schemes and custom colors as set by using the Colors option in Control Panel. |
Control.ini |
Patterns and Screen Saver.x subkeys in #USR\Control Panel1 |
Describes elements of desktop appearance and behavior as set by using the Desktop option in Control Panel. |
Control.ini [MMCPL], [Drivers.Desc], |
#USR\Control Panel\MMCPL1; |
Contains values for installable drivers and devices used for multimedia as set by using the Drivers option in Control Panel. |
Progman.ini |
Groups, Restrictions, and Settings subkeys in #USR...\Program Manager2 |
Describes window appearance, groups and the icons in the groups, and restrictions on Taskbar operations. Restrictions are set in User Manager for Domains. |
Msmail32.ini |
USR...\Mail4 |
Contains parameters that can be set for Microsoft Mail. |
Schdpl32.ini |
#USR...\Schedule+5 |
Contains parameters that can be set for Schedule+. |
Winfile.ini [settings] |
#USR...\File Manager2 |
Describes the appearance and behavior of items in File Manager as set by using the Windows NT Explorer. |
1 Full path = HKEY_CURRENT_USER
2 Full path = HKEY_CURRENT_USER \Software \Microsoft \Windows NT\CurrentVersion
3 Full path = HKEY_LOCAL_MACHINE \Software \Microsoft \Windows NT\CurrentVersion
4 Full path = HKEY_LOCAL_MACHINE \Software \Microsoft \Microsoft Mail
5 Full path = HKEY_LOCAL_MACHINE \Software \Microsoft \Schedule+
Microsoft OS/2 Version 1.x Entries in the Registry
The Microsoft OS/2 version 1.x subsystem starts whenever a user starts an OS/2 character-based application on an Intel-based computer. The Registry entries for the OS/2 subsystem are found under this key:
HKEY_LOCAL_MACHINE \System
\CurrentControlSet
\Control
\Session Manager
\SubSystems
The OS2 entry in this subkey describes the path to the executable file used to start the OS/2 subsystem. The directory path for the OS/2 library is the Os2LibPath value defined under the Session Manager\Environment subkey.
When Windows NT is installed on a computer, if Setup finds a copy of Config.sys for OS/2, a copy is placed in the Systemroot\System32 directory. This information is used to configure the OS/2 subsystem whenever an OS/2 application is started. If a Config.sys file is not found, a substitute is created in the Registry, with the following values:
PROTSHELL=C:\os2\pmshell.exe c:\os2\os2.ini c:\os2\os2sys.ini %Systemroot%\system32\cmd.exe SET COMSPEC=%Systemroot%\system32\cmd.exe
The OS/2 Config.sys information is stored in the following Registry entry:
HKEY_LOCAL_MACHINE \Software
\Microsoft
\OS/2 Subsystem for NT
\Config.sys
The other subkeys under the OS/2 Subsystem key do not contain entries.
If you subsequently edit the C:\Config.sys file by using a text editor, the LIBPTH=, SET PATH=, and SET WINDIR= entries are appended to the end of the file from the Windows NT environment. Any changes made to the path or environment variables take effect after the system is shut down and restarted.
For details about managing this environment under Windows NT, see Appendix B, "Other Application Environments," in Windows NT Server Concepts and Planning.
You can disable an OS/2 subsystem in Windows NT and still run a bound application under a VDM. Many bound applications run better under a VDM than under the OS/2 subsystem.
To disable the OS/2 subsystem in Windows NT
In Registry Editor, change the value of GlobalFlag to 20100000 in the following Registry path:
HKEY_LOCAL_MACHINE \System
\CurrentControlSet
\Control
\SessionManager
You can also use Forcedos.exe, a utility supplied with Windows NT in the Systemroot\System32 subdirectory. This enables you to run a bound application under a VDM. To see how to use the Forcedos utility, type forcedos /? at the command prompt.
POSIX Entries in the Registry
The POSIX subsystem starts whenever a user starts a POSIX application. The Registry entries for the POSIX subsystem are found under this key:
HKEY_LOCAL_MACHINE \System
\CurrentControlSet
\Control
\Session Manager
\SubSystems
The Posix entry in this subkey describes the path to the executable file used to start the POSIX subsystem. The POSIX subsystem does not have any parameters or environmental variables that the user can set.