Hello,
I am trying to build a script that reads a text file with multiple lines (every line has a folder name that needs to be deleted).
Then I want to look for the folder name in the folder list (using _FileListToArrayRec) and if the folder name is found - delete it.
This is the code I have so far, but it fails on line 43 - "Array variable has incorrect number of subscripts or subscript dimension range exceeded"
would appreciate some help.
AutoIt
#include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <file.au3> #Include <Date.au3> #include <Array.au3> ; ***** Create local logs Eof() ; Create a constant variable in Local scope of the filepath that will be read/written to. ; Open the file for reading and store the handle to a variable. ; Read the contents of the file using the handle returned by FileOpen. ; Retrieve a list of all the folders in $sRoot, and store them as an array in $aList Global $aList = _FileListToArrayRec ($sRoot, "*", 2, -2) ; _FileListToArray("path" [, "Filter" [, Flag]]) ; Look at what _FileListToArray() puts into $aList If FileExists($sRoot & "\" & $aList[$i] & "\" & $aArray[$i]) Then _filewritelog ($log, "Deleting, " & $aArray[$i])