Question: Let's say you want to temporarily exclude a **.config** file from being applied as a patch by Sitecore. Normally, you would either:

* Delete the file;
* Or rename it to have an extension different from **.config**.

Is there any other way of disabling a **.config** file? I don't want to change the file name or its contents (due to deployment process intricacies).

Answer: 
You can set the "Hidden" file attribute. Sitecore will not patch in any hidden files, even if they have the **.config** extension. The same is also true for folders, setting the "Hidden" attribute will mean the folder is not processed and the files contained within will not be loaded either.

[![Hidden property](https://i.stack.imgur.com/k16sj.png)](https://i.stack.imgur.com/k16sj.png)

You can find the exact code in `LoadAutoIncludeFiles()` method in `Sitecore.Configuration.ConfigReader` class:

```cs
protected virtual void LoadAutoIncludeFiles(ConfigPatcher patcher, string folder)
{
    if (!Directory.Exists(folder))
      return;
    foreach (string file in Directory.GetFiles(folder, "*.config"))
    {
        if ((File.GetAttributes(file) & FileAttributes.Hidden) == (FileAttributes) 0)
          patcher.ApplyPatch(file);
    }
    foreach (string directory in Directory.GetDirectories(folder))
    {
        if ((File.GetAttributes(directory) & FileAttributes.Hidden) == (FileAttributes) 0)
          this.LoadAutoIncludeFiles(patcher, directory);
    }
}

```

NOTE: The above is decompiled code and I have modified it for berevity.
You can make your configuration file hidden, which will cause Sitecore to NOT read that configuration file.

But, don't know how to set the hidden attribute automatically from the deployment process.

One option would be, you manually set the file properties to hidden on the server/instance and then stop the already existing file deployment to that certain folder. (But, this will also introduce a problem in case you change any configuration on those files)