Export (0) Print
Expand All
2 out of 5 rated this helpful - Rate this topic

Disabling EFS for a Specific Folder

You can disable EFS on any folder by using Windows Explorer to set the System attribute to "on." This takes advantage of the safety precaution that prevents the encryption of files that are needed for the system to start. There are some folders, however, that cannot be marked as system folders. An example is the Profiles folder, which contains Ntuser.dat files.

To disable EFS on folders that cannot be marked as system folders


  • Use the Winadvapi API, which has the following format:


WINADVAPI

BOOL

EncryptionDisable(

IN LPCWSTR DirPath,

IN BOOL Disable

)

/*++

This routine disables and enables EFS in the directory DirPath.

Arguments are:

DirPath - Directory path.

Disable - TRUE to disable (FALSE to enable)

The return value is:

TRUE for SUCCESS

--*/

The header file for this is Winefs.h. This API disables or enables EFS in the folder that is passed in. It creates a Desktop.ini file with these lines:

[Encryption]

Disable=1; (or Disable=0)

If Desktop.ini already exists, the API adds these lines to the file. Manually adding the lines to a Desktop.ini file has the same effect.


Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.