Reads a value from a standard format .ini file.
IniRead "filename", "section", "key", "default"
Parameters
filename | The filename of the .ini file. |
section | The section name in the .ini file. |
key | The key name in the in the .ini file. |
default | The default value to return if the requested key is not found. |
Return Value
Success: | Returns the requested key value. |
Failure: | Returns the default string if requested key not found. |
Remarks
A standard ini file looks like:
Related
IniDelete, IniWrite, FileReadLine
Example
Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
var = IniRead "C:\Temp\myfile.ini", "section2", "key", "NotFound"
WScript.Echo "Result: " & var