This little function gives the following:
section of the value
Key of the value
line no. in .ini file
ToFind=SomeValue IniFile=Inifile.ini Loop, Read, %IniFile% { IfInString, A_LoopReadLine,[ IfInString, A_LoopReadLine,] SetEnv, Section, %A_LoopReadLine% StringGetPos, EqPos, A_LoopReadLine, = StringTrimLeft, Value, A_LoopReadLine, %EqPos% IfInString, Value, %tofind% { StringLeft, Found, A_LoopReadLine, %EqPos% ;Available info: ;%Section% = section of the value ;%ToFind% = value to be found ;%Found% = Key of the value ;%a_index% = line no. in .ini file Msgbox,0,Found, %Section%`n`n%Found%=%ToFind%`n`n(Line %a_index%) } }