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.

Update: This bug has been fixed in the newer Windows 10 versions.

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:

Windows 10 Build was 10586.104 when this article was posted.

One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support, my reader. It won't take more than 10 seconds of your time. The share buttons are right below. :)

About the author

Ramesh Srinivasan founded back in 2005. He is passionate about Microsoft technologies and he has been a Microsoft Most Valuable Professional (MVP) for 10 consecutive years from 2003 to 2012.

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

  1. Thanks! This was very helpful as I was mystified by the backup software I use (SyncBack by 2BrightSparks, an excellent utility) not backing up a very small number of PDF files. It turns out it doesn’t back up files with the Temporary File attribute set. I found another way of restting the Temporary File attribute: create a new zipped folder. Copy file into zipped folder. Delete original file. Remove file from zipped folder. Delete zipped folder. File uis the same, without the Temporary File attribute.


Leave a Reply