79

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?

studiohack
  • 13,477
John2496
  • 2,249

10 Answers10

70

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.


32

I just went to RegEdit> HKEY_LOCAL_MACHINE > SOFTWARE > Classes

Found .log

Added a new String Value with Value Name PerceivedType and Value Data text.

Started working straight away.

ba_ul
  • 103
user255627
  • 321
  • 3
  • 2
19

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

Anthony K
  • 473
12

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

http://blogs.msdn.com/b/toub/archive/2006/12/14/preview-handler-association-editor.aspx

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: http://answers.microsoft.com/en-us/windows/forum/windows_7-files/no-preview-available-there-are-several-files-that/9a93872f-db8e-450a-96b1-951a3d687fd9?page=2&tm=1423925169058#LastReply

Direct download link to app: https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/01/28/65/88/PreviewHandlerEditor.zip

5

To view .ai in windows 7 preview handler

  1. Navigate to .ai folder in the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Classes.ai
  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!

2

In addition to the accepted answer: If you don’t have the privilege to add a key under HKEY_CLASSES_ROOT\.log (e.g. on a computer in an office environment):

You can create the same keys under HKEY_CURRENT_USER\Software\Classes\.log

Worked for me with Windows 10.

2

Using powershell

[microsoft.win32.registry]::SetValue("HKEY_CURRENT_USER\Software\Classes\.js", "PerceivedType", "text")

Thanks to Daryn's comment

andreikashin
  • 179
  • 1
  • 9
2

Try please:

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

DIF
  • 205
0

I'm too lazy to looking for the .ext(the extension file i want). So, i do:

Go to Regedit(i do with Windows+R hotkey and 'regedit' input) and set the quick view as text like above answer

Go... RegEdit> HKEY_LOCAL_MACHINE > SOFTWARE > Classes and ...

After that, export and save(ex: log.reg) this config with right-click menu enter image description here

So, with another file extention you can edit(and save) above log.reg with your wanna .ext Examle for .less file

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes.less] @="txtfile" "PerceivedType"="text"

Double click this file to apply effect.

Note: I think yo should do it your self because some(strange) .reg can be harm for your system

0

Easy to do with PowerShell.

An example that sets text preview for .js extension:

Set-ItemProperty Registry::HKEY_CLASSES_ROOT\.js -Name PerceivedType -Value text
Set-ItemProperty Registry::HKEY_CLASSES_ROOT\.js -Name 'Content Type' -Value 'text/plain'

or if you want to set it for multiple extensions (.js and .php for example):

'.js', '.php' | % { 
    Set-ItemProperty Registry::HKEY_CLASSES_ROOT\$_ -Name PerceivedType -Value text
    Set-ItemProperty Registry::HKEY_CLASSES_ROOT\$_ -Name 'Content Type' -Value 'text/plain'
}
Tolga
  • 246