Holy cow, I wrote a book!
A customer wanted to know how they could write a program that
automatically checked and unchecked the box that appears
on a file's property sheet on the General tab,
clicking the Advanced button,
and then checking or unchecking the item whose name keeps
The checkbox maps to the file attribute formally known as
and informally known as FANCI (pronounced like the
Checking the box clears the attribute, and unchecking the box
sets the attribute.
The customer liaison replied,
"Thanks for your assistance.
The customer was able to use the
method with the values in the
enumeration to manipulate the indexing attribute.
The customer has a follow-up question, however:
‘I need this change to be applied recursively
to all files in a entire directory subtree.
Is there a single series of Visual Basic commands
that will accomplish this,
or do I need to write a loop by hand?’"
This question kind of ran off topic for the product team
and fell more in line with Developer Support.
I suggested that the follow-up question be redirected
to the Visual Basic support team.
For me, it was interesting that
(1) the customer liaison was himself not aware enough
to realize that the question had changed audiences,
(2) the customer was so helpless that they couldn't
look for the answer themselves.
The file system itself pays no attention to the FANCI bit.
It's just a signal to any program that does file content
indexing that this particular file should be skipped.
Whether any particular search index program respects the
flag is something you need to take up with the vendor
of that search index program.
(As far as I'm aware, all Microsoft search indexes should
honor the flag.)