Comment make windows explorer preview scripts and other text fichiers

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Comment make windows explorer preview scripts and other text fichiers

Message par ForumBot »

Quand vous 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 ....

Comment make windows associate .py files as text like files for the preview pane?
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Comment make windows explorer preview scripts and other text fichiers

Message par ForumBot »

The answer came from [this link](https://superuser.com/questions/91804/windows-7-preview-other-file-types-as-text-in-preview-pane) this link as [music2myear](https://superuser.com/users/74026/music2myear) mentioned but the accepted answer in that link n'a pas fonctionné for me.

What a fonctionné pour moi was 2nd answer in the thread. Member [user255627](https://superuser.com/users/255627/user255627) points out the correct key is `HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.py` which requires attribute `PerceivedType REG_SZ text`.

J'ai créé an attribute in this key with `reg` command. Vous pouvez 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.

from windows invite de commandes cmd.exe

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

```

Si vous ne have reg permissions to HKLM (local machine) vous pouvez utiliser HKCU (current user)

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

```

Vous pouvez 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.
Répondre

Revenir à « Personnalisation Windows »