Excluding Files in a Listing

(imported topic written by SystemAdmin)

What is the best way to exclude multiple files when listing files in a folder. Maybe a bad day for me, but I can’t seem to get it right.

(names of files of folder “c:\ntutils” whose ((name of it as lowercase != “kx32.dll”) or (name of it as lowercase != “kx95.dll”)))

(imported comment written by NoahSalzman)

There are a few ways to do it. The main thing is you need an

and

instead of an

or

.

(names of files of folder “c:\ntutils”) whose ((it as lowercase is not “kx32.dll”) and (it as lowercase is not “kx95.dll”) and (it as lowercase is not “foo.dll”))

(imported comment written by jessewk)

If there are lot of individual exclusions I find the set inspectors make it much easier to edit the list:

elements of (set of names of files of folder “c:\ntutils” - set of (“kx32.dll”; “kx95.dll”))

1 Like

(imported comment written by SystemAdmin)

Thanks guys… I was using and before, changed to or when I was playing with the code… Looks like the big difference was where I put the () vs. (names of files of folder “c:\ntutils”), because I couldn’t get this to work (names of files of folder “c:\ntutils” whose ((name of it as lowercase != “kx32.dll”) and(name of it as lowercase != “kx95.dll”)))…

I like the elements. Gonna try to use that so I use that structure more often!