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.
Hoping this answer will help someone in the future, Sitecore 9 now has this feature. You can disable any config file or folder by Adding the patch file to a section and add the mode="Off" attribute. for example:

```
1 <add path="Sitecore.Analytics.Config" type="File" mode="Off" /> 

```

`2 <add path="zCustom" type="Folder" mode="Off" />`

for more information you can check <https://doc.sitecore.net/sitecore_experience_platform/developing/developing_with_sitecore/customizing_server_configuration/disable_a_patch_file#_Disable_a_single>