Enable Previews for new file extensions

Posted: February 8, 2013 in Solved, Windows General
Tags: , , , ,

In Windows Explorer the preview pane is something I normally turn off to give me more screen space. There are times though when it can be really handy. For example when browsing through a large number of text files or images rather than opening each one individually.

preview1

So what do you do when you have an unusual file extension that doesn’t work with the preview pane?

A program I use creates a queue of files with an extension of “.cnm”. They are plain text files, but when you try to see them in the preview pane, you just get the “No Preview Available” message. This has actually bugged me for YEARS but for some reason I just kept finding other ways to deal with it.

So I had a moment today where I had hundreds of these files I want to flick through and I finally decided to figure this out once and for all.

SOLUTION

The first thing is to get it associated with a program that you know works with preview for the type of file this is. In this case we want Windows to consider a CNM file the same as a text file, so I’m going to set it up the same as a TXT extension

1. Open the file. Because Windows doesn’t recognise what type of file it is, it will ask what you want to open it with. Choose “Select a program from a list of installed programs”

Preview1a

2. Select Notepad (or whichever program is appropriate), and leave the “Always use the selected program…” box ticked

Preview1bwin8.open

3. Open REGEDIT and browse to “Computer\HKEY_CLASSES_ROOT\[extension]”

(steps updated from suggestion by “Guest”)

reg-ext

4. On the right-hand pane, right-click and select new string value

new-string

5. Name the new key “PerceivedType” and set the value to “text”

perceivedtype

6. Now go and check your file and the preview pane should now work to display the contents

preview7

Comments
  1. Marjorie Roswell says:

    Thank you!

  2. Guest says:

    It’s much easier than that – just add string value to the new extension PerceivedType and set it to ‘text’. Done.

  3. Al says:

    Thanks! Very helpful when needing to open a file with one type of program, but preview it with another (like notepad to examine XML header info in notepad prior to opening with a default program).

  4. Rob says:

    You hero. I’ve been fighting this problem with .bad files dropped by our SMTP server. I knew it would be some kind of tweak to the extension handler and this works perfectly. This is going to make life a lot easier.

  5. Gordon says:

    Thank you soooo much! Used on Windows 10.

  6. eris discord says:

    also make sure in
    folder options
    –view
    —-always view icons never thumbnails
    is unchecked

  7. trophyjoe says:

    Worded like a champ and easy too! Thanks from the bottom of my feet!

  8. trophyjoe says:

    Meant to say “Worked like a champ…”, but come to think of it, the wording was pretty good.

  9. MATT VINSON says:

    Awesome. Can I display a .png rather than show text?

    • Scott says:

      .png is usually associated by default to display in preview. It uses “PerceivedType=image”.
      If that doesn’t work then check you have an application installed to display png files

  10. Yves Trottier says:

    Actually, it can be even simpler than what’s presented above:
    Just by using a simple .reg file, one can import the PerceivedType key into the registry in the right place in just a few clicks. Using this as a reference:

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\.ext]
    “PerceivedType”=”text”

    Saving it into a .reg file, and changing the .ext extension to the one you want to add, you simply need to double click on the file, agree to update the registry, and VOILA. It’s done.

  11. Ronnie says:

    Thanks

  12. Amit P. Kudva says:

    Hi Scott,
    I have installed Polaris Office (PO) in place of Microsoft Office (MO) and want to view all office files on the preview pane. *.doc, *.ppt, *.xls,*.docx, *.pptx, *.xlsx, etc,…

    Can you please guide me what I have to out preview the files.
    Unlike MO, for PO I can see only one option when for “Open with – Default Program”, i.e.Polaris Office. I don’t see Word, Excel, Powerpoint options separately.

    Since I had installed Open Office earlier, the string values in Regedit for .docx (example) is

    Default = OpenOffice.Docx
    PerceivedType = document

    What should I change it to to get the preview pane working?

    • Scott says:

      I don’t know Polaris Office, so that might depend on PO having a preview filter available to do this.
      The best approach might be to right-click a .doc file, “Open with”, “choose default program”. Select the Polaris Office exe and the “always open with” option. That will change the Default key, and if there is a preview filter available it might work.
      If it works, then repeat for the other doc types, or you could probably just copy the reg key for the default that is set.

  13. Paul Johnson says:

    Thanks Scott, for keeping this alive. I’ve done a new build with LibreOffice 5 and windows 7, but I can’t preview my spreadsheets or documents. I have not installed MS Office. I can’t preview my xls or doc files, or even the ods or odt files. Very irritating. Can I infringe on your hospitality one more time? I’m afraid that I might need the same detail you’ve provided earlier, or perhaps more. Thank you very much.

  14. Sagar says:

    Is there a way to change this without REGEDIT

    • Scott says:

      The change needs to be made in the registry, but there are several ways that can be done.
      You can create a .reg file of the changes and double click or execute from a script to “import”. You could also use powershell, vbscript or a command line tool like reg.exe

  15. Dave Hogg says:

    Late to the party – but thanks for the tip 🙂

  16. Slinky-Chris says:

    I’d like to see someone figure this out for Windows 10 to enable previewing of ‘.eml’ files within explorer. This used to work by default if using Windows Live Mail but that’s been replaced by Windows 10 Mail app and the preview function has gone 😦

  17. rontarrant says:

    This is going into my goodie bag as the best tip of 2018. Thank you so much!

  18. rontarrant says:

    (even though it’s five years old)

  19. bartoliniinc says:

    This helped me review a bunch of CNC g-code files quickly. Thank you!

  20. bugmanmd says:

    thanks very much for this ! Had installed Softmaker Office last night – today no txt file previews. Softmaker Office had set that registry value to “document.” Per your instructions, I just set it to “text,” and now all is well. Great tip!

  21. John says:

    Worked great for .json manifest files. Also, how to set html preview type? As when you click on html file, it renders in preview as webpage, but in registry there is “PerceivedType=text”.

    • Scott says:

      Are you asking how to have html preview, or are you saying it gives an html preview even though it is set to text?
      I usually just fine another file type that already does what I want and copy the settings it has used.
      The preview doesn’t work for all applications though, they need to have a preview extension registered, so in some cases it might depend on the browser you are using and if it supports preview.

  22. Netspin says:

    For the first time in 30 years of PC experience, I just dared to and complete a hack of the Microsoft Windows registry which was introduced 27 years ago.
    But before-hand I knew enough to also learn about restore points and their installation.
    Thanks, Scott for your easy-to-follow “add a file that will be visible in the view pane” instructions. Not a touch down or home run but something far more permanent, a function to facilitate knowledge. Because of this multi-pronged success for the first time ever I got my 32 year old .max files to display in the view plane.

  23. Timothy Martin says:

    7 years later, and just finding this gem LOL, thank you.

  24. Morag says:

    Oh man – it is amazing what you find on the internet when you use the right search strings in Google! Thank you for this, it is EXACTLY what I needed. Made my day! 7 years after it was written – still works just fine.

  25. […] thanks to Scott Williams who wrote about this in a blog post in 2013 which I finally stumbled across in 2020 and it made my […]

  26. SACHIN BHAWAR says:

    Thanks

  27. […] .greenshot com o Handler nativo do Windows Explorer para a visualização de arquivos PNG. O Scott Williams escreveu em 2013 um artigo sobre como exibir o conteúdo de arquivos de texto com extensões […]

  28. Zona De Marrones says:

    Still woking in windows 10 latest version!! thanks

Leave a comment