If you’ve associated PDF files with Mozilla Firefox to make use of Firefox’s built-in PDF viewing capability, the PDF and HTML files would show up with the same Firefox icon in File Explorer. This post tells you how to set a custom different icon for PDF files, with Firefox as the default PDF viewer.
First, create or download a .ico file which you want to set as the default icon for PDF files, and save it to a permanent location. You should be able to find a suitable icon from FindIcons or IconsPedia. For this post, I used this icon from IconsPedia.
Add .PDF File Type to Firefox’s Default Programs Registration
1. Start the Registry Editor (Regedit.exe) and go to:
HKEY_CURRENT_USER\SOFTWARE\Clients\StartmenuInternet\FIREFOX.EXE\Capabilities\FileAssociations or HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartmenuInternet\FIREFOX.EXE\Capabilities\FileAssociations
2. In the right-pane, create a DWORD value named .pdf
3. Double-click .pdf and set its value data to FirefoxPDF
4. Select HKEY_CLASSES_ROOT, and create a new subkey named FirefoxPDF
5. With FirefoxPDF selected, double-click (default) and set its value data to PDF File.
What you mention here is displayed in the Type column in Details view and in the Preview pane. You can type in any description as you’d like, say “Firefox PDF Document”.
6. Under FirefoxPDF, create a subkey named DefaultIcon
7. Select DefaultIcon and double-click the (default) value in the right pane.
8.Type in the .ico file with full path there.
9. Then create the following key:
Note: The “shell” key doesn’t exist by default. You need to create it, and its subkeys as above, manually.
10. With the above key selected, double-click (default) and set it’s value data as follows:
"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -osint -url "%1"
That assumes Firefox.exe is located under C:\Program Files (x86) folder, in a Windows x64 system. The Program Files path would be C:\Program Files in a x86 system. Or, if you’ve installed Firefox under your user profile, type the appropriate path. You can find the Firefox.exe file location by right-clicking on the Mozilla Firefox shortcut in the Taskbar or Start menu, and checking its properties.
So you now have the following registry keys/structure.
HKEY_CLASSES_ROOT | FirefoxPDF |-- DefaultIcon |-- shell |---- open |----- command
REG file for the above settings
To automate steps 1-10 above, you can use the REG file below:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\FirefoxPDF] @="PDF File" [HKEY_CLASSES_ROOT\FirefoxPDF\DefaultIcon] @="C:\\Program Files (x86)\\Mozilla Firefox\\Pdf.ico" [HKEY_CLASSES_ROOT\FirefoxPDF\shell] @="open" [HKEY_CLASSES_ROOT\FirefoxPDF\shell\open\command] @="\"C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe\" -osint -url \"%1\"" [HKEY_CURRENT_USER\SOFTWARE\Clients\StartmenuInternet\FIREFOX.EXE\Capabilities\FileAssociations] ".pdf"="FirefoxPDF" [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartmenuInternet\FIREFOX.EXE\Capabilities\FileAssociations] ".pdf"="FirefoxPDF"
Copy the above lines to Notepad, and save it with .REG extension. Double-click the .REG to apply the settings to the registry. Before applying, inspect (and change) the paths for Firefox.exe and the custom icon file accordingly, so as to match the paths in your system.
Set Firefox as the Default PDF Viewer
Now, reset the file association for PDF files to Microsoft Edge (or any other program), and then set it back to Mozilla Firefox, using the Open with dialog. Another option is to use the Default Programs applet.
Open classic Control Panel by right-clicking Start, and clicking Control Panel. Set the view type to icons, and click Default Programs.
Click Set your default programs, select Mozilla Firefox from the list, and click “Choose defaults for this program”.
Select .pdf from the list, and click Save.
That’s it! You’ve now changed the PDF file type icon, and the association set to Mozilla Firefox.
About the author
Ramesh Srinivasan founded Winhelponline.com back in 2005. He is passionate about Microsoft technologies and has a vast experience in the ITeS industry — delivering support for Microsoft's consumer products. He has been a Microsoft MVP [2003 to 2012] who contributes to various Windows support forums.