When you encrypt a folder, you receive:

An error occurred applying attributes to the file:
<Drive:>\Folder\Filename - Access is denied.

The most likely cause of this error is that a file or sub-folder has the System attribute turned on.

To fix the problem, remove the system attribute, using the attrib command:

<b>attrib \[+r|-r\] \[+a|-a\] \[+s|-s\] \[+h|-h\] <a class="" drive href="/article/tips/jsi-tip-2881-you-receive-an-access-denied-error-when-encrypting-a-folder--74200?topic=%5c%5d%5c%5bpath%5c%5d%20filename%5c%5d%20%5c%5b/s%5c%5b/d">\]\[path\] filename\] \[/s\[/d</a>

+r</b> Sets the Read-only file attribute.

<b>-r</b> Clears the Read-only file attribute.

<b>+a</b> Sets the Archive file attribute.

<b>-a</b> Clears the Archive file attribute.

<b>+s</b> Sets the System file attribute.

<b>-s</b> Clears the System file attribute.

<b>+h</b> Sets the Hidden file attribute.

<b>-h</b> Clears the Hidden file attribute.

<b>\[\[drive:\]\[path\] filename\]</b> Specifies the location and name of the directory, file,
 or set of files you want to process. You can use wildcard characters (? and *)
 in the filename parameter to display or to change the attributes for a group of files.

<b>/s</b> Processes matching files in the current directory and all of its subdirectories.

<b>/d</b> Processes directories.
NOTE: Never encrypt files or sub-folders in %SystemRoot%. Doing so will likely prevent your installation from restarting.