I can left click on one or more pdf, png, xlsx, docx, etc file in Windows Explorer and send it to the printer, but when doing so on a text file (with either a txt extension or php extension which is my ultimate end goal), the dialog does not present the option to print. Is it possible to configure which file types Windows deems "printable"? Any workarounds? Note that I do not appear to have access to add something to my SendTo folder on the PC in question.

Can print Can't print


There are several ways to do this.

Choose a file extension as a txtfile by adding a line in the registry for each extension type. ^R(Run) regedit (enter)

  • locate \HKEY_CLASSES_ROOT.txt
  • right click add new string Value and enter name "perceivedtype" then the value "txtfile"

from (default)


PerceivedType txtfile

Then locate in registry


Right click add new Expandable String Value

leave name as (default) and enter the value below

%SystemRoot%\system32\NOTEPAD.EXE /p %1

Or replace with your preferred notepad+++ etc with its path

This may already be there for various other file types


If you prefer different print formats, search for options on the commandline that select font, paper, size etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.