How to copy a file and inherit Windows EFS?

I have a program in which I create a temporary file in% USERPROFILE% \ AppData \ Local \ Temp and then call the rename.c _wrename () function to effectively move this file to a directory that is encrypted using Windows EFS. The problem is that this file does not inherit the encryption settings of this directory. Is there a way to overcome this (I don't want to encrypt the Temp, btw folder)?

+3
source share
1 answer

I believe that you want to use Win32 functions instead of C. functions. I'm not sure what MoveFileExwill do what you want. CopyFileExcan be used for this, and then the original can be deleted. CopyFileExeven has flags that allow it to fail / not if encryption is not possible at the destination.

+3
source

All Articles