When you preview PDF files in File Explorer or Microsoft Outlook on your Windows 10 or Windows 11 computer, the preview pane may show the directory index of the current folder instead of previewing the PDF file’s contents.
In some cases, it shows the following error:
File not found
It may have been moved, edited, or deleted.
ERR_FILE_NOT_FOUND
Cause
The above symptoms are caused by a bug in the Microsoft Edge PDF Preview handler and you are now having Microsoft Edge PDF previewer handler as your system’s default PDF previewer in your computer. The Microsoft Edge’s PDF preview handler fails to generate the preview if the PDF file name or the folder path contains the “#” symbol — e.g., test#123.pdf, #test123.pdf
If the # symbol is present at the beginning of the file or folder name, the Edge PDF previewer shows the INDEX OF (directory index) in the preview pane. In case the # symbol is present in the middle of the file or folder name, it throws the error “File not found” (ERR_FILE_NOT_FOUND) .This issue is also seen when previewing PDF attachments in Microsoft Outlook.
If the path to the file or the filename itself contains the pound # symbol, Edge’s PDF previewer might disregard all the path that comes after the pound. Removing the # symbol from the file or folder name resolves this issue.
If you don’t prefer removing the # symbol in the file/folder name, then follow the solution below.
Solution:
To resolve the PDF preview problem without renaming the PDF files or the folder(s), you have to do the following steps:
- The first step: Switch back to use Foxit preview handler as your system default PDF previewer.
- Th second step: Prevent Edge Updater (Setup.exe) from Modifying the default previewer settings in our system.
The first step: Switch back to use Foxit preview handler as your system default PDF previewer.
To switch to Foxit as default PDF Previewer quickly using command-line, please do the following:
1:Open command prompt with administrator right.
2:Please paste the the follow command-line into the “Administrator :Comand Prompt” window,please Enter key on your keyboard to execute this command-line:
reg add HKCR\.pdf\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f} /ve /d {1B96FAD8-1C10-416E-8027-6EFF94045F6F} /f
The above command would change the default PDF preview handler module in the following registry location automatically:
HKEY_CLASSES_ROOT\.pdf\shellex\{8895b1c6-b41f-4c1c-a562-0d564250836f}
The changes are usually instant; no need to restart Windows.
The second step: Prevent Edge Updater (Setup.exe) from Modifying the default previewer settings in our system.
With “First step″ done, there is an additional procedure you may wish to perform.
The Microsoft Edge software update (setup.exe) process overwrites your default PDF preview handler setting (i.e., making the Edge PDF previewer the default) every now and then. Re-running the above commands (every time Microsoft Edge updates itself) may be inconvenient to the user.
To work around that, you have two options:
- Stop Edge setup from changing the default Preview Handler via an undocumented registry value.
(or) - Set the registry key permissions so that the Microsoft edge’s setup.exe process (that runs as NT AUTHORITY\SYSTEM) can’t write to the .pdf registry key.
Method 1: Stop Edge Setup from changing the default Preview Handler
1:Open an admin Command Prompt window.
2:Run the following commands:
reg add HKCR\CLSID\{3A84F9C2-6164-485C-A7D9-4B27F8AC009E} /v EnablePreviewHandler /t REG_DWORD /d 0 /f
reg add HKCR\WOW6432Node\CLSID\{3A84F9C2-6164-485C-A7D9-4B27F8AC009E} /v EnablePreviewHandler /t REG_DWORD /d 0 /f
3:Exit the Command Prompt window
Editing the registry manually
If you wish to edit the registry manually rather than running the using command-line, then follow these steps instead:
1:Start the Registry Editor (regedit.exe)
2:Go to the following branches one by one:
HKEY_CLASSES_ROOT\CLSID\{3A84F9C2-6164-485C-A7D9-4B27F8AC009E}
HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{3A84F9C2-6164-485C-A7D9-4B27F8AC009E}
3:Double-click the value named EnablePreviewHandler and set its data to 0.
4:Exit the Registry Editor.
The above command-line/registry setting prevents the Edge setup process from changing the default PDF preview handler module in the registry.
(Despite the above registry modification, you can still use Edge’s Preview handler if you want; it’s just that the setup process won’t set it as the default every time. In other words, it does NOT disable Edge’s PDF preview handler capability.)
Method 2: Prevent Write access to PDF Preview Handler Registry key
(If the above procedure has resolved the issue for you, then please skip the following routine.)
1:Start the Registry Editor (regedit.exe)
2:Go to the following branch:
HKEY_CLASSES_ROOT\.pdf\shellex\{8895b1c6-b41f-4c1c-a562-0d564250836f}
3:Right-click {8895b1c6-b41f-4c1c-a562-0d564250836f} and choose Permissions…
4:Click Advanced.
5:Click Add.
6:Click “Select a principal”
7:Type SYSTEM and click OK. Microsoft Edge setup.exe runs under the SYSTEM account. On the other hand, if you wish to deny write access to the registry value for ALL user accounts, type EVERYONE and click OK.
8:In the Type: dropdown, select Deny
9:In the Applies to: dropdown, select “This key only“
10:Click “Show advanced permissions”
11:Select the “Set Value” checkbox.
12:Click OK.
13:Click OK.
14:Click Yes when you see the following prompt:
You are setting a deny permissions entry. Deny entries take precedence over allow entries. This means that if a user is a member of two groups, one that is allowed a permission and another that is denied the same permission, the user is denied that permission. Do you want to continue?
15:Exit the Registry Editor.
That’s it. You’ve revoked the “Set value” permissions for this key (for every user on the computer). Microsoft Edge setup/update processes (Setup.exe or MicrosoftEdgeSetup.exe) can’t modify the registry value during software updates; they silently encounter the ACCESS DENIED error when attempting to update the PDF preview handler registry value. Regardless, the updater should be able to install/update Edge Chromium successfully.
Other workarounds: If you don’t want to modify registry permissions, then you may choose to run the reg.exe command-line every time Microsoft Edge updates itself. Or, you may create a desktop shortcut/Batch file/Task Scheduler Startup or Logon job to execute the above command automatically.
(Microsoft Edge version is 101.0.1210.32 Official build as of this blog post and everything written on this page is based on Edge 101.0.1210.32.)
Related Articles
Register Plugins for Previewer
The file cannot be previewed because there is no previewer installed for it in Outlook