Possible Duplicate:
How to set the default program for opening files without an extension in Windows?

Many files originating in the UNIX world come without file extension. Popular examples include README, INSTALL, LICENSE.

We know for a fact that these are text files. It is therefore a bit disappointing not to be able to just double-click them open in Explorer and see them in Notepad (actually, Notepad2 because of the UNIX line endings which silly Microsoft Notepad doesn't render correctly).

Does anyone know of a way to create a file association for, say, README files without extension? This could then be replicated to cover the most frequently occurring file types, and then double-clicking them open would work.

Update (Sort of in response to all your comments.) Thanks, folks, your comments and answers have helped me.

@Indrek, yes, I was under the assumption that you could somehow create an association for just README or Makefile, and couldn't do so for files without extension. Turns out the contrary is true, and yes, that is a workaround that neatly solves the issue.

Ultimately, I just want to be able to double-click to open a README or Makefile, that's all.

@Sampo, the SendMe trick is also useful, although usability is not as great as a straight double-click. (I'm really lazy sometimes.)

Turns out the following trick using ftype and ftype from an Administrator prompt does the double-click enabling job:

assoc .=no_ext
ftype no_ext=%SystemRoot%\system32\NOTEPAD.EXE %1
:: You can see it created some entries in the registry:
reg query hkcr\no_ext /s
reg query hkcr\. /s
  • My understanding is that from Windows' perspective, if there is no . in the filename, it doesn't have an extension. And if it doesn't have an extension, you can't associate a program to open it with. So a README file is no, in fact, a README file... it's just a file. I'd be interested to see if there's some sort of workaround for this.
    – nhinkle
    Sep 3 '12 at 18:42
  • 2
  • @Indrek Seems like a straight up duplicate to me? Sep 3 '12 at 18:58
  • @nhinkle Don't know if my workaround is good enough but it does the job, of course we can make it better by moving menu item to root menu. Maybe i'll look in it when i have more than few minutes for it. Sep 3 '12 at 19:06
  • 2
    @techie007 Not necessarily. The OP is asking if it's possible to create a file association based on filename, to which the answer is "no". Creating an association for files with no extension is a workaround in this case.
    – Indrek
    Sep 3 '12 at 19:07

You can't create a file association based on the filename, but you can create one for files with no extension. To do that, save the following as a .reg file and double-click on it:

Windows Registry Editor Version 5.00




@="Notepad.exe %1"

Replace Notepad.exe with whatever text editor you wish to use.

You can, of course, also create the registry keys and value manually with regedit.exe.

Also see this question and its answers.

  • Yeah, this is it! From the answers in the question you're referring to, I very much prefer the assoc/ftype, run from an administrator prompt. Thanks!
    – Lumi
    Sep 4 '12 at 0:00

You could always create additional menu item, that will open selected file on notepad, for all files.

It is extremely simple, here is how to do it:

1. Open Send To folder. In Windows 7 this folder is C:\Users\TestUser10\AppData\Roaming\Microsoft\Windows\SendTo, just change TestUser10 to be your user name or use All Users profile.

2. Create new shortcut link to notepad.exe with description `"Notepad".

Now it is ready for use

Right click on any file and select "Send To" => "Notepad" and Windows will open selected file in notepad.

Note: This works with all Windows versions with "Send To" functionality, you just need to find Send To folder and create shortcut to notepad.exe. 95, 98, ME, 2000, XP, Vista, 7 ... has it but folder path could vary.


Okay, I got it (after reading techie007's comment).

Here is how you can associate program to FILENAME (or FILENAME.EXT if you want to) by using above instructions as starting point.

Just do not create shortcut as I suggested above but create new File Editor.cmd and here is contents of File Editor.cmd (Change cases as you like):


START notepad.exe %1

START mspaint.exe %1

edit.com %1


Okay, that was just quick sketch. Anyone is welcome to improve it, one suggestion is using IF ... ELSE statements to get default fallback program (hex editor for example) for any file type/name that is not defined. With conditional statements one could also use findstr regular expressions for determining launcher by parts of filename.

Update: Integration with file associations

This part is about integrating above with Indrek's answer.

Idea is pretty simple, just write above batch file (or even better, real program with similar functionality) but instead of "Send To"-folder place it to System32 folder (just don't place it inside Send To).

After you have your script/program ready follow Indrek's answer with one exception: use file editor.cmd %1 (or whatever you've named your batch/program) instead of notepad %1.

This enables you to use both: selecting application by filename and simple double clicking from Windows Explorer.

  • The GOTO idea is nice and simple, but there should be a default behavior. Some sort of Open with dialog, if possible.
    – Dennis
    Sep 3 '12 at 19:54
  • Thank you, this is useful to know. For this case, however, I find the ASSOC/FTYPE for . more practical. +1 nonetheless.
    – Lumi
    Sep 3 '12 at 23:58
  • @Lumi If you want to improve functionality of <i>unknown file association</i> see my last update. This is only useful if you want different app for README and LICENSE. Sep 4 '12 at 15:28

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