I need to loop from target folder and sub folder for all picture that contain the text from the list.txt
IE: 99-2554, 75-8875
Folders can have picture .jpg, .gif, .tif... named 99-2254-1, 99-2254-2, fullsize-99-2254... that's why I do not put prefix or suffix or file extension. If the file contains my string then it need to be copied to the backup folder.
However, below code does not seem to work. Any idea how I can do this ? Thanks!
Code: Select all
numpad1::
msgbox, start!
Destination:="V:\pictures\20210608-backup"
SearchLocation:="V:\pictures\all"
loop, Read, list.txt
{
Find_it:=A_loopReadLine
Loop Files, %SearchLocation%\*.*, R
{
IfInString, A_LoopFileName, %Find_It%
{
;msgbox, found it! %A_LoopFileName%
FileCopy, %A_LoopFileFullPath%,%Destination%\%A_LoopFileName%
Filedelete, %A_LoopFileFullPath%
}
}
}
msgbox, end!
return