Mapping .INI File Entries to the Registry

This article was previously published under Q102889
Under Microsoft Windows NT, Windows 2000, and Windows XP, .INI file variables are mapped into the Registry as defined in the
mapping key. The Win32 Profile application programming interface (API)functions look for a mapping by looking up the filename extension portionof the profile file. If a match is found, then the search continues underthat node for the specified application name. If a match is found, then thesearch continues for the variable name. If the variable name is not found,the value of the (NULL) variable name is a string that points to a node inthe Registry, whose value keys are the variable names. If a specificmapping is found for the variable name, then its value points to theRegistry value that contains the variable value.

The Profile API calls go to the Windows server to look for an actual .INIfile, and read and write its contents, only if no mapping for either theapplication name or filename is found. If there is a mapping for thefilename but not the application name, and there is a (NULL) applicationname, the value of the (NULL) variable will be used as the location in theRegistry of the variable, after appending the application name to it.

In the string that points to a Registry node, there are severalprefixes that change the behavior of the .INI file mapping:
   ! - This character forces all writes to go both to the Registry and       to the .INI file on disk.		
   # - This character causes the Registry value to be set to the value       in the Windows 3.1 .INI file when a new user logs in for the       first time after setup.		
   @ - This character prevents any reads from going to the .INI file       on disk if the requested data is not found in the Registry.		
   USR: - This prefix stands for HKEY_CURRENT_USER, and the text after          the prefix is relative to that key.		
   SYS: - This prefix stands for HKEY_LOCAL_MACHINE\Software, and the          text after the prefix is relative to that key.		
prodnt inifilemapping

Article ID: 102889 - Last Review: 01/18/2007 22:40:00 - Revision: 3.2

Microsoft Windows NT 4.0, Microsoft Windows 2000 Standard Edition, the operating system: Microsoft Windows XP

  • kbenv KB102889