Windows – How to add default preview for files in Explorer

file extensionpreview-panewindowswindows-explorer

If I click on a .ts (typescript) file and activate the Preview Pane in Windows Explorer, then I see a preview of the file:

enter image description here

Why? Because I set Notepad to open .ts files.

But I have .js files which I set Notepad++ to open them and I don't see a preview in the Preview Pane:

enter image description here

Question

How can I show .js files in the Preview Pane and still keep Notepad++ as this file type's default program?

I don't want to open Notepad++ with the option: Right-click > Open With.

I have Windows 7.

Best Answer

Follow these directions to edit the Registry and assign the Windows Text Preview Handler to the .js file extension. (Based on this How To Geek article.)

  1. Open Registry Editor
  2. Navigate to HKEY_CLASSES_ROOT\.js and make note of the content of the (Default) value. This is the ProgID to which the .js extension is registered: enter image description here
  3. Navigate to the ProgID's key. We'll find our key at HKEY_CLASSES_ROOT\JSFile
  4. Expand the key. If necessary, create a subkey named ShellEx
  5. Under the ShellEx key, create a new key named {8895b1c6-b41f-4c1c-a562-0d564250836f}. Note: According to MSDN the presence of this exact value tells Windows that this is a preview handler.
  6. Select this newly created key and set its (Default) value to {1531d583-8375-4d3f-b5fb-d23bbd169f22}. This is the ID for Windows' Text Preview Handler. enter image description here
  7. The change will take effect immediately.
Related Question