Hi, I'm running this command:
exiftool -Encryption "C:\tmp\"
tmp is a directory
And exiftool is showing every filepath even if they don't have encryption, how can I do so I only get messages about files that do have encryption tags?
Is this possible to do?
I have a lot of files (10K+) so exiftool returning the path of every single file is not what I'm looking for. I'm using Windows 10.
Thank you.
Use the -if option (https://exiftool.org/exiftool_pod.html#if-NUM-EXPR).
exiftool -if "$Encryption" -Encryption "C:\tmp\"
Thank you! That worked. Also is there any difference in using this instead:
exiftool -if $pdf:encryption -Encryption "C:\tmp\"
is PDF: redundant or wrong? (that's command line is what I gathered from reading the documentation you linked before seeing that you gave me the command already)
If you use pdf:encryption, then the command will only be true for files have have encryption in the PDF group (https://exiftool.org/TagNames/PDF.html). It would not extract tags in other groups. For example, the Palm MOBI Encryption tag (https://exiftool.org/TagNames/Palm.html#MOBI).
In this case, it's fine. A bit redundant as the Encryption tag only appears in a very few groups. But in other cases where the same tag name can appear in multiple groups, you might want to include the group and you might not, depending upon what you're looking for. For example, CreateDate appears in both the EXIF (EXIF:CreateDate) and the XMP group (XMP:Createdate or more specifically, XMP-xmp:CreateDate). If you don't care which tag you get, then you would just use CreateDate. Otherwise if you wanted one or the other, you would specify the group.
Also, you want to make sure you have quotes around the second argument of the -if option. Double quotes in CMD, single quotes in PowerShell/Mac/Linux.
Thank you for the explanation. I understood perfectly.