Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to preview .js, .php, and other file extensions as text in explorer on Windows 7.

Any ideas on how I can accomplish this?

share|improve this question

migrated from Jan 5 '10 at 20:18

This question came from our site for professional and enthusiast programmers.

In the meantime, check out:… – ZoogieZork Jan 5 '10 at 20:02

6 Answers 6

up vote 37 down vote accepted

On top of using PreviewConfig, you will also have to add entries into the registry to get it working on Windows 7.

  • Open the registry editor (regedit in the start menu search) and navigate to computer\HKEY_CLASSES_ROOT\.FILE_EXT, where FILE_EXT is the extension you want to add, such as .nfo

    enter image description here

  • Make 2 new string values (REG_SZ) under the file extension's key, Content Type and PerceivedType

    enter image description here

  • Set the value of Content Type to text/plain and PerceivedType to text.

share|improve this answer
On Win 7, I got not success on .m3u using PreviewConfig or the manual method too . Any ideas? – ChrisJJ Mar 12 '13 at 22:55
I am not totally sure but it is not Perceived Type, it is PerceivedType – Devid Oct 25 '13 at 22:15
Success!! Per the answer below for most file types I did not need to manually edit the registry but for .config files I did because it had already been registered as ContentType application/xml and did not want to update. Thanks! – GrokSrc Mar 20 '14 at 19:19
Note well (I should have): – dcromley Mar 7 at 2:28
I have found this method (registry fix) works for .eml files without bothering with PreviewConfig at all - Windows 8.1. – gogoud Jul 2 at 12:07

As of June 2010, PreviewConfig will handle Windows 7 file preview duties without the need for any manual registry editing.

share|improve this answer

I just went to RegEdit> HKEY_LOCAL_MACHINE > SOFTWARE > Classes

Found .log

Added a new String Value called PerceivedType with Value Date text.

Started working straight away.

share|improve this answer
where did you get this tutorial from? please consider adding your source. – Lorenzo Von Matterhorn Sep 19 '13 at 10:25
The benefit of this method is that if you change the viewer for the underlying type all types that are perceived as it will change too. – Sam Hasler Jun 30 '14 at 11:56

You can solve this by using a little tool created by a Microsoft guy (Stephen Toub) called "PreviewHandlerEditor.exe", which is available here:

Download and open the tool, uncheck "Only show classes associated with this handler", select a registered preview handler from the dropdown menu (e.g. "Windows TXT Previewer"), scroll through the list of classses/extensions, and select the file type you are having trouble previewing in Windows search.

I found this answer via:

Direct download link to app:

share|improve this answer
I find this tool to be more capable than the one in the accepted answer. It allows me to add and remove handlers from filetypes without limitation. Thanks, @Michael for the link to the download - the links in Toub's original blog posting no longer work. – yosh m Apr 19 at 11:42

To view .ai in windows 7 preview handler

  1. Navigate to .ai folder in the registry key HKEY_LOCAL_MACHINE\SOFTWARE\
  2. Under that make a key named ShellEx if not already there
  3. Under ShellEx create a key name {8895b1c6-b41f-4c1c-a562-0d564250836f}
  4. Under this new key change the data value to {DC6EFB56-9CFA-464D-8880-44885D7DC193} (I would have posted an image but Im not allowed to by the system but I'm sure you got it!)

Now even Adobe Illustrator files show up in the preview handler and you look like a Pro! This is possible as the preview handler for PDF files and AI files are the same so all that is being done is copy/paste the PDF one to the AI one!

share|improve this answer

Try please:

PreviewConfig Tool Registers File Types for the Preview Pane in Windows 7/Vista

share|improve this answer
Could you summarize your article here? We prefer you don't just link your own site as an answer – Simon Sheehan Feb 15 '12 at 22:39
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Ramhound Jul 16 at 12:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.