INI file
An INI file is a configuration file for computer software that consists of plain text with a structure and syntax comprising key–value pairs organized in sections.[src] The name of these configuration files comes from the filename extension INI, short for initialization, used in the MS-DOS operating system, which popularized this method of software configuration.[src] The format has become an informal standard in many contexts of configuration, but many applications on other operating systems use different filename extensions, such as conf and cfg.[src]
An INI file is a configuration file for computer software that consists of plain text with a structure and syntax comprising key–value pairs organized in sections.[src] The name of these configuration files comes from the filename extension INI, short for initialization, used in the MS-DOS operating system, which popularized this method of software configuration.[src] The format has become an informal standard in many contexts of configuration, but many applications on other operating systems use different filename extensions, such as conf and cfg.[src] last modified 1 April 2001 by John Doe [owner] name = John Doe organization = Acme Widgets Inc.[src] [database] use IP address in case network name resolution is not working server = 192.0.2.62 port = 143 file = "payroll.dat" Data in INI is held in key–value pairs called key or property.[src] Key may thus either refer to the entire key–value pair or only its key.[src] In some contexts a key is called a property name.[src] In its textual representation, the key–value pair is represented by either a line or a multiline where the start of the value is indicated by a delimiter, most often an equals sign ( = , ASCII 0x3D) but sometimes also a colon ( : , ASCII 0x3A) or whitespace (occasionally used in the GNU world ).[src] The key's key appears to the left of the delimiter, is often non-empty and should not contain the delimiter.[src] Some flavours allow escape sequences in the value.[src] In the Windows implementation, the equals sign and the semicolon are reserved characters and cannot appear in the key.[src] Any whitespace surrounding the key is stripped by the parser.[src] The value can contain any character (in Windows-style, no whitespace surrounds the delimiter: e.g.[src] IconFile=Folder.ico ).[src] Key–value pairs may textually look like: key=key=v name =value sem=; semver=v5822.433.2 [project] name = orchard rental service (with app) target region = "Bay Area" TODO: advertise vacant positions legal team = (vacant) [fruit "Apple"] trademark issues = foreseeable taste = known [fruit.Date] taste = novel Trademark Issues="truly unlikely" [fruit "Raspberry"] anticipated problems ="logistics (fragile fruit)" Trademark Issues=\ possible [fruit.raspberry.proponents.fred] date = 2021-11-23, 08:54 +0900 comment = "I like red fruit." [fruit "Date/proponents/alfred"] comment: Why, \ \ \ I would buy dates.[src] folding: Is "\\\\\nn" interpreted as "\\n" or "\n"?[src] Or does "\\\\" prevent folding?[src] editor =My name may contain a \\ newline.[src] [section] domain = example.com [section.subsection] foo = bar In some cases relative nesting is supported too, where a leading dot expresses nesting to the previous section: [section] domain = example.com [.subsection] foo = bar Historically, ways for expressing nesting alternative to the dot have existed too (for example, IBM's driver file for Microsoft Windows devlist.ini , in which the backslash was used as nesting delimiter in the form of [A\B\C] ; or Microsoft Visual Studio's AEMANAGR.INI file, which used a completely different syntax in the form of [A] and B,C,P = V ).[src] Some parsers did not offer nesting support at all and were hierarchy-blind, but nesting could still be partially emulated by exploiting the fact that [A.B.C] constitutes a unique identifier.[src] ![src] /bin/convert-ini-to-perl | perl | ssh wikipedia.org upload --sanitise=no Ambiguous without further knowledge of the INI dialect: is the value "live" or "live # dangerously"?[src] I like to = live # dangerously var = a var = a ; This is an inline comment foo = bar # This is another inline comment Under the WinAPI's GetPrivateProfileString 's dialect, comments must occur on lines by themselves.[src] include int main(int argc, TCHAR *argv[]) { TCHAR dbserver[1000]; int dbport; GetPrivateProfileString(TEXT("database"), TEXT("server"), TEXT("127.0.0.1"), dbserver, sizeof(dbserver) / sizeof(dbserver[0]), TEXT(".\\dbsettings.ini")); dbport = GetPrivateProfileInt(TEXT("database"), TEXT("port"), 143, TEXT(".\\dbsettings.ini")); // N.B.[src] WritePrivateProfileInt() does not exist, only WritePrivateProfileString() return 0; } The third parameter of the function is the default value, which are and respectively in the two function calls above.[src] If the argument supplied for this parameter is , the default is an empty string, .[src] Under Unix, many different configuration libraries exist to access INI files.[src] They are often already included in frameworks and toolkits.[src] Examples of INI parsers for Unix include GLib, iniparser and libconfini.[src] GetPrivateProfileString("owner", "name", ...[src] , "c:\\programs\\oldprogram\\dbsettings.ini"); INI mapping takes this Profile API call, ignores any path in the given filename and checks to see if there is a Registry key matching the filename under the directory: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\ CurrentVersion\IniFileMapping If this exists, it looks for an entry name matching the requested section.[src] If an entry is found, INI mapping uses its value as a pointer to another part of the Registry.[src] It then looks up the requested INI setting in that part of the Registry.[src] If no matching entry name is found and there is an entry under the entry name, INI mapping uses that instead.[src] Thus each section name does not need its own entry.[src] So, in this case the profile call for the [owner] section is mapped through to: where the " " Registry entry name is found to match the requested INI key.[src] The value of "John Doe" is then returned to the Profile call.[src] In this case, the @ prefix on the default prevents any reads from going to the file on disk.[src] The result is that any settings not found in the Registry are not looked for in the INI file.[src] The " " Registry entry does not have the prefix on the value; thus, for the [database] section only, settings in the Registry are taken first followed by settings in the file on disk.[src]
43 sentences · 43 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"INI file." encyclopegia.org, 2026, https://encyclopegia.org/wiki/ini-file. Accessed 01 December 2026.
Chicago
"INI file." encyclopegia.org. Accessed December 1, 2026. https://encyclopegia.org/wiki/ini-file.
APA
encyclopegia.org. (2026). INI file. Retrieved December 1, 2026, from https://encyclopegia.org/wiki/ini-file
Accessed December 1, 2026 · CC BY-SA 4.0 · citation page · JSON