How to Enable Preview of .LOG Files in File Explorer

By default, the preview capability exists for most text-based files in File Explorer. However, for some file types, such as .log or .py, a preview may not be generated by default and you see the message “No preview available” in the preview pane in File Explorer.

You can enable preview of such files (.log and .py) in the preview pane using a registry edit.

Resolution

To enable the preview of .log files in the Explorer preview pane, please open Command Prompt (admin) and run the following command:



reg add "HKEY_CLASSES_ROOT\.log" /v "PerceivedType" /d "text" /f

Likewise, you can enable text previews for .py file type using the following command:

reg add "HKEY_CLASSES_ROOT\.py" /v "PerceivedType" /d "text" /f

Close all File Explorer windows. If the changes don’t take effect immediately, log off and log back in to your account.


One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support. It won't take more than 10 seconds of your time.

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a ten-time recipient of the Microsoft MVP award in Windows Desktop Experience (Windows Shell), from 2003 to 2012. Ramesh founded Winhelponline.com in 2005.

Leave a Comment