76
General Software Discussion / Detect and list all files with windows encryption enabled
« on: May 20, 2015, 05:52 PM »
This is part of a project that is gradually getting done that to the help for several nice DC Posters. Due to problems that came up on during the project, I need to locate a method of recusively searching files for a specific property. At first, I had thought the file length could be used and to that end came up with a simple one-liner which can scan for and make a list of all zero length files. Unfortunately, not all of them are zero length.
The problem is (was) "Windows encryption" which had been used apparently at some point on many of the files which makes them impervious to overwriting by non encrypted versions of the same file whether it is newer or not.
I have decided my only choice is to locate them all in advance, copy the encrypted versions to a new sub-folder which will then allow me to copy the unencrypted version into the vacated sub-folder. This is important because the location of these files has to remain as it is but the encrypted ones have no keys (or if they do I doubt anyone would know where they are) which effectively makes them worthless. I need to find them and move them out of the way to make room for copies of the same files and folders which are also on other disks in their unencrypted format.
Some of these files showed zero length and I had hoped they would all be such. Unfortunately this was not the case.
If it is of any use to someone here is my version for finding Zero length files and copying the names to a list. I am not sure how to edit this to scan for windows encryption though.
This was written for use in a batch file and could be modified for direct entry by removing the extra %'s.
4WD I expect you will knock this one out of the ballpark?
The problem is (was) "Windows encryption" which had been used apparently at some point on many of the files which makes them impervious to overwriting by non encrypted versions of the same file whether it is newer or not.
I have decided my only choice is to locate them all in advance, copy the encrypted versions to a new sub-folder which will then allow me to copy the unencrypted version into the vacated sub-folder. This is important because the location of these files has to remain as it is but the encrypted ones have no keys (or if they do I doubt anyone would know where they are) which effectively makes them worthless. I need to find them and move them out of the way to make room for copies of the same files and folders which are also on other disks in their unencrypted format.
Some of these files showed zero length and I had hoped they would all be such. Unfortunately this was not the case.
If it is of any use to someone here is my version for finding Zero length files and copying the names to a list. I am not sure how to edit this to scan for windows encryption though.
Code: Text [Select]
- @echo off
- for /r %%F in (*) do if %%~zF==0 echo â%%Fâ >> zerobytefiles.txt
4WD I expect you will knock this one out of the ballpark?