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
- REPARSE_POINT 0x400
- COMPRESSED 0x800
- OFFLINE 0x1000
- NOT_CONTENT_INDEXED 0x2000
- 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!
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.
This is an excellent post. The reason I came across this is; I was working on an issue where DFS replication was not synching certain files.
A bunch of troubleshooting was done, before I looked for file attributes.
When I came across the T indicator within Windows Explorer UI (within the properties of a file). I was searching for how to remove this.
This wasn’t the site which had the 0xFEFF reference. That site was specific to the DFS issue I had (couple hours digging for that answer).
But after solutioning for my DFS issue, I decided to try to find a way to identify files w/o changing them.
That’s when I came across this site. I am now going to mess around with FSUTIL.
Thanks for that information.
I have been looking for a utility/tool, that will list files recursively, with what each files attributes are.
Seems to me that pipe command:
ForEach-Object -process {if (($_.attributes -band 0x100) -eq 0x100) {$_.attributes = ($_.attributes -band 0xFEFF)}}
only works if the T (temporary) attribute is the only attribute set.
A file I have with both AT (Archive, Temporary) attributes set, do not get modified with the command.