случайные цифры и буквы
MsgBox(0,'',_SearchTreeForFile("C:", "NOTEPAD.exe"))
Func _SearchTreeForFile($sRootPath, $sFileName)
If StringRight($sRootPath, 1) <> '\' Then $sRootPath &= '\'
Local $sOutputPathBuffer = ''
Local $aRet = DllCall("imagehlp.dll", 'long', 'SearchTreeForFile', 'str', _
$sRootPath, 'str', $sFileName, 'str', $sOutputPathBuffer)
If $aRet[0] = 1 Then
Return $aRet[3]
Else
Return 0
EndIf
EndFunc
а если еще ниже, то без dll.В первой теме, там где приведен ниже пример - подключен внешний dll.
#include <Array.au3>
$aFiles = _FileSearch(@DesktopDir, "*.txt")
_ArrayDisplay($aFiles)
Func _FileSearch($sPath, $sMask="*")
If Not StringInStr(FileGetAttrib($sPath & "\"), "D") Then Return SetError(1, 0, 0)
Local $hSearch, $sFindNext, $sFilePath, $iPathIsFolder, $i = 0, $sRet = ""
Local $sRegExpFilter = StringReplace(StringReplace(StringReplace($sMask, ".", "\."), "*", ".*"), "?", ".")
Local $iMax_Ret_Paths = 10000
Local $aPathesArr[$iMax_Ret_Paths+1] = [1, $sPath]
While $i < $aPathesArr[0]
$i += 1
$hSearch = FileFindFirstFile($aPathesArr[$i] & "\*")
If $hSearch = -1 Then ContinueLoop
While 1
$sFindNext = FileFindNextFile($hSearch)
If @error Then ExitLoop
$sFilePath = $aPathesArr[$i] & "\" & $sFindNext
$iPathIsFolder = StringInStr(FileGetAttrib($sFilePath & "\"), "D")
If $iPathIsFolder Then
If $aPathesArr[0] >= $iMax_Ret_Paths Then
$iMax_Ret_Paths *= 2
ReDim $aPathesArr[$iMax_Ret_Paths+1]
EndIf
$aPathesArr[0] += 1
$aPathesArr[$aPathesArr[0]] = $sFilePath
ElseIf StringRegExp($sFindNext, "(?i)\A" & $sRegExpFilter & "\z") Then
$sRet &= $sFilePath & @CRLF
EndIf
WEnd
FileClose($hSearch)
WEnd
$sRet = StringSplit(StringStripWS($sRet, 3), @CRLF, 1)
If @error Then Return SetError(1, 0, -1)
Return $sRet
EndFunc
Это раз.Мы имеем папку *-savedata где * случайные цифры и буквы.
Это два.Код:Необходимо узнать эти буквы и получить доступ к файлу lastsave.xxx.
Это три.А так узнали имя папки и задаем список нужных файлов.
Это четыре.Вот если бы можно просто узнать имя этой папки, часть ее имени известно.
$sPath = @AppDataDir & "\x32Loader\*-savedata\lastsave.xxx"
If _FileExistsEx($sPath) Then
MsgBox(64, 'Title', 'Exists, full path:' & @CRLF & $sPath)
EndIf
Func _FileExistsEx(ByRef $sPath)
If Not StringRegExp($sPath, "[\*\?]") Then
Return FileExists($sPath)
EndIf
$aSplit = StringSplit($sPath, "\")
$sPath = $aSplit[1]
For $i = 2 To $aSplit[0]
If StringRegExp($aSplit[$i], "[\*\?]") Then
$hSearch = FileFindFirstFile($sPath & "\" & $aSplit[$i])
$iExtended = 0
If $hSearch <> -1 Then
While 1
$sNext = FileFindNextFile($hSearch)
If @error = 1 Or @extended = 1 Then
$iExtended = @extended
ExitLoop
EndIf
If $i = $aSplit[0] And @extended = 0 Then
$iExtended = 1
ExitLoop
EndIf
WEnd
FileClose($hSearch)
If Not $iExtended Then
Return 0
Else
$sPath &= "\" & $sNext
EndIf
EndIf
Else
$sPath &= "\" & $aSplit[$i]
EndIf
Next
Return FileExists($sPath)
EndFunc