How can I programmatically read and write the file and folder attribute which is set by the Windows "Allow files on this drive to have contents indexed in addition to file properties" dialog?
Like this apparently:
// read
var isContentIndexed = ((attributes & FileAttributes.NotContentIndexed) != FileAttributes.NotContentIndexed);
// set
File.SetAttributes(path, (File.GetAttributes(path) | FileAttributes.NotContentIndexed));
// remove
File.SetAttributes(path, (File.GetAttributes(path) & ~FileAttributes.NotContentIndexed));