Similar logic to Tim's fine post (I don't have SSIS installed but I did have BimlStudio so please accept different icons for SSIS objects).

3 Variables
CurrentFilename
string - this will contain the current file name, which may or may not contain the exclusion value
ExclusionList
string - a delimited string of folders you'd like to exclude
IncludeCurrent
boolean - False, and we'll override per loop
Inside the Foreach File Loop, I'd use a Script Task as it's going to be the most effective method for splitting the ExclusionList
as well as performing the file system tests. The result of running the Script Task is that we will set the value of @[User::IncludeCurrent]
to true or false.
The Precedent Constraint logic between the Script Task and the Dataflow Task is going to be simplified from the reference post to just @[User::IncludeCurrent]
.
If the condition is met, we execute the DFT task. Otherwise, we skip it.
Test for inclusion
You will need to pass the CurrentFilename and ExclusionList as read only variables into the Script task. IncludeCurrent will be passed as a read/write variable.
// use the .net native split method to split on commas
var fileList = Dts.Variables["ExclusionList"].Value.Split(new Char[] {','});
// We could inline this for the next operation but you might have need for this elsewhere
string currentFilename = Dts.Variables["CurrentFilename"].Value.ToString();
// https://stackoverflow.com/questions/500925/check-if-a-string-contains-an-element-from-a-list-of-strings
bool isFound = fileList.Any(s=>currentFileName.Contains(s));
// Assign the results back to our SSIS scoped variable
Dts.Variables["IncludeCurrent"].Value = isFound;
Notes on Raj More's proposal
SPLIT_STRING assumes SQL Server 2016+. As a consultant, I wish I could count on the newest features available but that often isn't the case.
I believe that a challenge you might experience with the double for each loop approach is that inner recordset (the query's split list) is marked as exhausted after the first pass so you'd need to modify this approach as FELC All files -> OLE DB Query -> FELC Filter
If you have more complex testing that pure string matching, the script approach will provide the maximum flexibility.