« ManBabies! | Home | PowerShell Gem #1 »

Individual Entry With Comments


June 28, 2009

Teaching Windows about Files Without Extensions

Filed under Software

Files that don't have an extension (like "makefile") do not work well in Windows.

  • In Vista, these files are not even searched! If you see a file called "makefile" in a directory and type "make" in the search box, Vista will report no files are found! NOTE: Windows 7 doesn't have this problem.
  • Also, these files are not indexed, so searching for the contents of an extension-less file will return zero hits. I expect this works in Windows 7, but I haven't tested.
  • If you try to open a file without an extension, you will always be asked which application should open this file. The "Always use the selected program to open this kind of file" checkbox is disabled, so you are constantly asked the same question, even when you open the same file over and over. This happens on Vista and Windows 7.

There is an easy fix for all of this:

Tell Windows that files that do not have an extension are the same as text files.

Here's how:

  1. Start->Search->regedit
  2. Go to Computer\HKEY_CLASSES_ROOT\.txt
  3. File->Export->txt.reg
  4. Open txt.reg in notepad
  5. Replace every ".txt" with "."
  6. Save the file
  7. Open the new txt.reg to import the settings into the registry

The extension-less updated txt.reg should look similar (depending on what you have installed on your OS) to this...

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.]
"PerceivedType"="text"
@="Notepad++_file"
"Content Type"="text/plain"
"Notepad++_backup"="txtfile"

[HKEY_CLASSES_ROOT\.\OpenWithList]

[HKEY_CLASSES_ROOT\.\PersistentHandler]
@="{5e941d80-bf96-11cd-b579-08002b30bfeb}"

[HKEY_CLASSES_ROOT\.\ShellNew]
"ItemName"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,\  6f,00,74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,\  00,6e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2e,00,65,00,78,00,65,00,2c,00,\
2d,00,34,00,37,00,30,00,00,00
"NullFile"=""

With this fix, files without an extension...

  • Have filenames that are searchable
  • Have contents that are searchable
  • Are associated with the application that opens your text files

P.S.: If you are using Notepad/Wordpad for text editing, please checkout Notepad++...I *love* it and you will too.

About

This page contains a single entry from the blog posted on June 28, 2009 10:30 PM.

The previous post in this blog was ManBabies!.

The next post in this blog is PowerShell Gem #1.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.34