Hi I have this piece of code i found in help file and it gives me partitions + other drives ( cd rom, usb, etc... ) So how can i make this now to loop through drives and search for file "test.txt", i tried with _FileListToArray() but it gives me error 1 ( Path was invalid ). #include <Array.au3>
#include <File.au3>
#include <AutoItConstants.au3>
Global $DT_ALL = "ALL", $aArray = DriveGetDrive($DT_ALL), $file = "test.txt"
If @error Then
; An error occurred when retrieving the drives.
MsgBox(0, "Error retrieving the drives", "Error : " & @error & ", Extended : " & @extended)
Else
For $i = 0 To $aArray[0]
; Show all the drives found and convert the drive letter to uppercase.
ConsoleWrite("Drives : " & StringUpper($aArray[$i]) & @CRLF) ; debug
;~ $aFileList = _FileListToArray(StringUpper($aArray[$i]) & "\")
;~ If @error = 1 Then
;~ MsgBox(0, "", "Path was invalid.")
;~ Exit
;~ EndIf
;~ If @error = 2 Then
;~ MsgBox(0, "", "Invalid $sFilter.")
;~ Exit
;~ EndIf
;~ If @error = 3 Then
;~ MsgBox(0, "", "Invalid $iFlag.")
;~ Exit
;~ EndIf
;~ If @error = 4 Then
;~ MsgBox(0, "", "No file(s) were found.")
;~ Exit
;~ EndIf
Next
_ArrayDelete($aArray, 0)
_ArrayDisplay($aArray, "test") ; debug
;~ _ArrayDisplay($aFileList, "$aFileList")
EndIf