#include <File.au3>
$sFolder = @ScriptDir & '\MyFolder'
$sTextAdd = 'Текст, который добавляем.'
$sTextSearch = 'Текст, который заменяем.'
$sTextReplace = 'Текст, на который заменяем.'
$sTextOld = ''
$sTextNew = ''
$aFileList = _FileListToArray($sFolder, '*.txt', 1)
If @error Then Exit
For $i = 1 To UBound($aFileList) - 1
$hFile = FileOpen($sFolder & '\' & $aFileList[$i], 0)
$sTextOld = FileRead($hFile)
FileClose($hFile)
$sTextNew = StringReplace($sTextOld, $sTextSearch, $sTextReplace) & @CRLF & $sTextAdd
$hFile = FileOpen($sFolder & '\' & $aFileList[$i], 2)
FileWrite($hFile, $sTextNew)
FileClose($hFile)
$sTextOld = ''
$sTextNew = ''
Next