Finding PDF files that are password protected, Script Columns


How do I find all PDF files on my drives that are password protected ?

I am using *.pdf in Name Matching and I searched through the various drop down selections like Document, Script Column available in Advanced but could not find any thing that will help me with finding password protected files.

Currently, I am looking to find only PDF that are password protected but in future if I want to expand this to other password protected files for Compresed files like .zip, .rar or Microsoft Office documents (.docx, .xlsx or .doc, .xls) etc. is there any way this can be achieved using the Find Files.

I am also using scripts to get additional columns like number of Pages in PDF .


It shows the column EE.PageCount in Script column


As this is a number, how do I provide a value in Enter text here to match to find all PDF files which are > 100 pages, = 1 page, < 10 pages and so on.

Refer to the the post Column to display number of pages for eBooks and for the script file.

Thanks and Regards,


That might be something your PDF software adds a column to File Explorer for. If so, the column could be imported into Opus (the same as the page count column is being imported in the script you linked to).

If there isn't a column in File Explorer for that information, you could look for a tool which adds one, or try making an Opus-specific script column, which would have to parse the PDF files to work out if they are encrypted or not. I don't know enough about the PDF format to say if that would be difficult or easy.

There is no general way to know if a file is encrypted (outside of NTFS encryption at the filesystem level, but that isn't what we're talking about here). The way to know will be different for each type of file.

Try editing the script to add col.type = "number" to the column definition, then clear the filter and create a new one:

option explicit

' pdfPageCount
' (c) 2018 sfranky

' This is a script for Directory Opus.
' See for development information.

' Called by Directory Opus to initialize the script
Function OnInit(initData) = "PDF page count"
	initData.desc = "Adds PDF Columns"
	initData.copyright = "(c) 2018 sfranky"
	initData.version = "1.0"
	initData.default_enable = true
	initData.min_version = "12.0.8"
	Dim props, prop, col
	Set props = DOpus.FSUtil.GetShellPropertyList("System.Document.PageCount", "r")
	for each prop in props
		Set col = initData.AddColumn
' = prop.raw_name = "PDFPages"
		col.method = "OnPDFColumn"
		col.label = "PDFPages"
		col.justify = "left"
		col.autogroup = true
		col.userdata = prop.pkey
		col.type = "number"
End Function
Function OnPDFColumn(scriptColData)

	scriptColData.value = scriptColData.item.shellprop(scriptColData.userdata)

End Function

I searched Google search and found utilities which add shell extensions and other functionalities like columns to File Explorer. However, I could not find any where it would identify protected file in File Explorer.

But I also came upon a free utility which does find protected PDF files and am sharing it here. It is useful in standalone mode and someone may find it useful.

If someone can figure out which PDF attribute it uses and if there is any way to incorporate it in Dopus Find Files, that will be great.