2

I want to use the Windows 10 Preview Pane to view the text of extensionless files (such as Dockerfile, Jenkinsfile, README, etc)

Is there a registry key in the HKEY_CURRENT_USER\Software\Classes tree that Windows uses to designate a files with no extension? I've tried using the full name of the file, [], and . as the key, to no avail.

Here's an example of it working on a .dockerignore file. The preview pane shows the file's contents.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\.dockerignore]
"Content Type"="text/plain"
"PerceivedType"="text"

Or is this simply not possible/supported in Windows?

KymikoLoco
  • 1,433
  • 1
  • 15
  • 17

2 Answers2

2
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\.]

[HKEY_CURRENT_USER\Software\Classes\.\ShellEx]

[HKEY_CURRENT_USER\Software\Classes\.\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}]
@="{1531d583-8375-4d3f-b5fb-d23bbd169f22}"

Here

  • HKEY_CURRENT_USER\Software\Classes\. means a file with no extension;
  • {8895b1c6-b41f-4c1c-a562-0d564250836f} means the preview handler;
  • {1531d583-8375-4d3f-b5fb-d23bbd169f22} means Windows TXT Previewer, see also output from reg query "HKCR\CLSID\{1531d583-8375-4d3f-b5fb-d23bbd169f22}"

Result check:

reg query "HKEY_CURRENT_USER\Software\Classes\." /S
HKEY_CURRENT_USER\Software\Classes\.\ShellEx

HKEY_CURRENT_USER\Software\Classes\.\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
    (Default)    REG_SZ    {1531d583-8375-4d3f-b5fb-d23bbd169f22}

Create an example:

echo a plain text file with no extension>D:\test\NoExtesionFiles\NoExtensionTxt

Result view:

enter image description here

JosefZ
  • 28,460
  • 5
  • 44
  • 83
  • For some reason that is not working on the machine I wanted it to, but my laptop it does. The ShellEx and Preview handler GUIDs were the key to this, PerceivedType just isn't enough :). Also the 'Unknown' key is for extensions that are not mapped to anything else, so that's nice to know as well! – KymikoLoco Aug 20 '19 at 14:31
0

To allow reading file content for files with .ext extensions in the windows 10 explorer preview pane, set

HKEY_CLASSES_ROOT\.ext
        PerceivedType     REG_SZ     Text

Usually the .ext key already exists, and it is simply a matter of adding the PerceivedType string value and setting it to Text. In my case, the . key with no extension didn't exist, so I created it (New key, .) and then added `PerceivedType' as above.

marzetti
  • 369
  • 4
  • 8