#include <file.au3>
Local $aName
Local $spath = 'Путь к папке'
Local $aPath = _FileListToArrayRec($spath, '*.ini', 1, 1, 0, 2)
If Not @error Then
For $i = 1 To $aPath[0]
$aName = StringRegExp($aPath[$i], '(?m)^(?:.*\\)([^\\]*?)(?:\.[^.]+)?$', 3)
If IsArray($aName) Then IniRenameSection($aPath[$i], 'Options', $aName[0])
Next
EndIf