$sLead = 'test'
$sExt = '.txt'
$sSearch = FileFindFirstFile(@ScriptDir & '\' & $sLead & '*')
$iMax = 0
While 1
$sFile = FileFindNextFile($sSearch)
If @error Then ExitLoop
$iDigit = Number(StringRegExpReplace($sFile, $sLead & '(\d+)' & $sExt, '\1'))
If $iDigit >= $iMax Then $iMax = $iDigit
WEnd
ShellExecute(@ScriptDir & '\' & $sLead & $iMax & $sExt)