Windows Search Not Finding PDF Files Created Using “Microsoft Print to PDF”

If you’re wondering why your PDF files created using Microsoft Print to PDF driver aren’t indexed by Windows Search and not appearing in Search results, here is why it happens.

Microsoft Print to PDF adds the FILE_ATTRIBUTE_TEMPORARY ("T") attribute when outputting to PDF.  As Raymond Chen [Microsoft] notes in his blog, if the "Temporary" attribute is set for a file, Windows Search doesn’t index it, and you can see that in the image below.

If you have a PDF writer software installed, open the PDF file that has the "T" attribute set, and save the file. This removes the "T" attribute.

Using BulkFileChanger to Remove Temporary Attribute

BulkFileChanger utility from NirSoft lets you set or unset Temporary attribute (or any other attribute) for the list of files you select.

Add the "Temporary" PDF files to the list box and select all. Click Actions, Change Time / Attributes (F6), set Temporary attribute to Turn Off, and click Do it.

Using PowerShell

This PowerShell command-line, posted by Directory Services Team Blog, removes the TEMPORARY Attribute for ALL file(s) in a folder, D:\Data in this example:

Get-childitem D:Data | ForEach-Object -process {if (($_.attributes -band 0x100) -eq 0x100) {$_.attributes = ($_.attributes -band 0xFEFF)}}

… and Search lists it now.

Check if the "T" Attribute is set for a file

Right-click on the file, click Properties. Click the Details tab to check the Attributes.

Using Command-line:

The Attrib command doesn’t tell if Temporary attribute has been set for a file; you need to use FSUtil to find it out.

fsutil usn readdata <filename>

File Attributes value 0x120 means ARCHIVE and TEMPORARY attributes are set. Here are the possible (bitmask) values: (from Directory Services – MS Team Blog)

  • READONLY 0x1
  • HIDDEN 0x2
  • SYSTEM 0x4
  • DIRECTORY 0x10
  • ARCHIVE 0x20
  • DEVICE 0x40
  • NORMAL 0x80
  • TEMPORARY 0x100
  • SPARSE_FILE 0x200
  • COMPRESSED 0x800
  • OFFLINE 0x1000
  • ENCRYPTED 0x4000

After using BulkFileChanger or the PowerShell command to remove the "T" attribute, running FSUtil now shows this output:

References and Credits

Here is the list of sites that I need to credit (mainly the Microsoft Team Blogs) for the knowledge they provided on this topic.

Why don’t all of my documents show up when I arrange my Documents library by Name? | The Old New Thing

DFSR Does Not Replicate Temporary Files | Ask the Directory Services Team

It’s only temporary | Larry Osterman’s WebLog

BulkFileChanger: Change date/time/attributes of multiple files

Any file with the "T" attribute set cannot be found in a – Microsoft Community (user JEJeePeeNL)

TechNet Forum FAQ: Temporary files are not replicated by DFSR

What Is Included in the Index (Windows)

Windows 10 Build was 10586.104 when this article was posted.

About the author

Ramesh Srinivasan founded back in 2005. He is passionate about Microsoft technologies and has a vast experience in Windows — delivering support for Microsoft's consumer products. He has been a Microsoft MVP (2003-2012) who contributes to various Windows support forums.

Leave a Comment