IniDelete

Deletes a value from a standard format .ini file.

IniDelete Filename, Section , Key

Parameters

Filename

Type: String

The name of the .ini file, which is assumed to be in A_WorkingDir if an absolute path isn't specified.

Section

Type: String

The section name in the .ini file, which is the heading phrase that appears in square brackets (do not include the brackets in this parameter).

Key

Type: String

If omitted, the entire section will be deleted. Otherwise, specify the key name in the .ini file.

Error Handling

An OSError is thrown on failure.

Regardless of whether an exception is thrown, A_LastError is set to the result of the operating system's GetLastError() function.

Remarks

A standard ini file looks like:

[SectionName]
Key=Value

IniRead, IniWrite, RegDelete, RegDeleteKey

Examples

Deletes a key and its value located in section2 from a standard format .ini file.

IniDelete "C:\Temp\myfile.ini", "section2", "key"