How do I copy an EFS encryted File to a USB drive that I cannot decrypt
Posted on 2010-08-22
I have 3 or 4 users a month that for one reason or another cannot boot their XP OS on their HD and need it to be re-imaged or replaced. I would like to boot to WINPE, copy the files to USB drive, re-format or replace the HD, then copy the files back. Some files are EFS Encrypted and the keys can be easily recovered from Active Directory after the HD is reformated and the files copied back to the HD. I have tried the API's CopyFile and CopyFileEx but neither seem to be able to just copy the file without first decrypting it. I do not want to decrypt the file while it is stored on the USB drive as the file may contain sensitive information and it is safer just to keep it encrypted while the OS is repaired. ImageX.exe can perform this task and I currently use it for this purpose by copying the files into a WIM file then onto USB. The problem with imageX.exe is that I would rather just perform the raw copy within my VB6 code and retain a more granular control over which files get copied and which get left behind.