Windows Explorer Preview Scripts – How to Enable

dialogscriptwindowswindows 7windows-explorer

When you click a file with the preview window open, windows will show you a preview if windows knows how to do it. But files like .json and .py will not preview.

It would be sometimes useful in the open dialog of any editor to preview a script before opening it. Most open dialogs will inherit the windows explorer preview settings but ….

How do you make windows associate .py files as text like files for the preview pane?

Best Answer

The answer came from this link this link as music2myear mentioned but the accepted answer in that link did not work for me.

What worked for me was 2nd answer in the thread. Member user255627 points out the correct key is HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.py which requires attribute PerceivedType REG_SZ text.

I created an attribute in this key with reg command. You can substitute .py with any extension type and enable a bunch of extensions this way. No need for a external program as mentioned in other thread.

reg add HKLM\SOFTWARE\Classes\.py /v PerceivedType /t REG_SZ /d text

You can query like this.

reg query HKLM\SOFTWARE\Classes\.py /s

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.py
(Default)    REG_SZ    Python.File
PerceivedType    REG_SZ    text

Thanks for the help guys. very useful.