I have a script that iterates through all the files and saves them to a list
The next time it runs, it reads the list as an array
and then determine if the files exist in turn
If it doesn't exist, remove the current item and save it as a list
However, some problems arise in this step
It only deletes a portion of it each time it starts
1,Loop files to arr
Code: Select all
FileEncoding "UTF-8"
Loop files "D:\1\2\*.*", "R"
FileAppend A_LoopFileFullPath "`r", "1.txt"
2,then i rename "D:\1\2\" to "D:\1\3\"
and run that
Code: Select all
FileEncoding "UTF-8"
indexArr := StrSplit(FileRead("1.txt"), "`r")
for i in indexArr
If ! FileExist(i)
indexArr.RemoveAt(A_Index)
msgbox indexArr.Length
But it gives 354 each time
Why