New Bookstore! Save 20% on books with discount code: LAUNCH
Web Dev + WordPress + Security

Associate Extensionless Files with Notepad in Windows XP

There are several files that appear not to have extensions in Windows XP. Perhaps the best known example is the HOSTS file. Files such as the HOSTS file that appear to be “extensionless” actually contain an invisible period “.” — or dot — at the end the file name. It is this invisible dot that will enable us to select a specific program with which to open files with no extensions.

Jump through the hoops

As web developers, we are constantly checking and consulting server-generated error_log files. Like the HOSTS file, the error_log files appear to have no associated extension. In Windows XP, opening extensionless files requires opening the “Open with…” dialogue box and scrolling through a long list of file types. And, although there is a checkbox option within the dialogue box enabling users to “Always use the selected program to open this kind of file,” the option is “greyed out” and useless. Thus opening an extensionless file requires four or five extra “clicks”, as well as the extra time it takes to jump through the hoops. This may not sound like a big deal, but try opening any number of files by this method and the extra clicks begin to add up.

After opening our millionth error_log file using the “Open with” method, we decided to confront the problem and devise a solution. After a bit of research, we were presented with several options: editing the registry, installing software, or tweaking Windows “Folder Options”. After fiddling with the registry and installing some software with no real progress, we decided to try the heretofore unsuccessful “Folder Options” method. Sure enough, armed with an invisible dot and a slight tweak, we were finally able to convince Windows XP to associate extensionless file types with Notepad, our program of choice for such files.

The Solution (Notepad)

Although this solution is relatively risk-free1, requiring no registry editing or software installation, the process is fairly sensitive, requiring careful attention. Below are two methods: the first associates extensionless files with Notepad, while the second does such with WordPad. Both assume you are running on a Windows XP operating system.

Here is the method of associating extensionless file types with Notepad in WinXP:

  1. Open Windows Explorer and go to Tools › Folder Options › File Types.
  2. Click the “New” button and type “.txt” in the “File Extension” field.
  3. Click on the “Advanced” button and the “Associated File Type” should read “Text Document”. If it is blank, or says something else, close everything out and start over, making sure to follow the steps in order.
  4. Finally, in the “File Extension” field, replace the “.txt” with a single dot, “.”
  5. Click “OK” and exit. Find or create an extensionless file and check it out.

The Solution (WordPad)

Here is a similar method of associating extensionless file types with WordPad in WinXP:

  1. Open Windows Explorer and go to Tools › Folder Options › File Types.
  2. Click the “New” button and type “.txt” in the “File Extension” field.
  3. Click on the “Advanced” button and the “Associated File Type” should read “Text Document”. If it is blank, or says something else, close everything out and start over, making sure to follow the steps in order.
  4. Open the “Associated File Type” dropdown menu. Scroll down and select “Wordpad Document”.
  5. Finally, in the “File Extension” field, replace the “.txt” with a single dot, “.”
  6. Click “OK” and exit. Find or create an extensionless file and check it out.

Footnotes

  • 1 It is always a good idea to backup your registry and other critical documents before implementing any system changes.

Jeff Starr
About the Author
Jeff Starr = Designer. Developer. Producer. Writer. Editor. Etc.
Banhammer: Protect your WordPress site against threats.

22 responses to “Associate Extensionless Files with Notepad in Windows XP”

  1. Marton Sari 2006/08/13 8:46 am

    After this you can associate it with anything you want. Just go to “Tools ? Folder Options ? File Types” again, select the first one in the list (the extensionless filetype), click “Modify” and select the appropriate program. The “Always use the selected program to open this kind of file” checkbox is greyed out again, but now it is checked!

  2. Jeff Starr
    Perishable 2006/08/15 6:46 am

    Excellent, Marton — thank you for the helpful information!

  3. Didn’t work with me!
    What’e wrong?

  4. Jeff Starr
    Perishable 2006/09/02 6:23 pm

    It is difficult to say, Fernando. Keep trying!

  5. I agree with Cameron, i’ve been dealing with this with files output from Kiwi conf puller and everytime having to ‘open with..’ Finally i realized there had to be a better way.. Thanks Perishable Press great tip!!

  6. Jeff Starr

    Many thanks for the kind remarks!

  7. CodeMonkey 2007/02/01 4:35 pm

    Great stuff! I work in a mixed development environment of Windows and linux, and I use a Windows system. My boss distributes his meeting agenda and minutes as an extensionless file, so I would sulk all meeting long cursing his name until I found your info. This little tip + Notepad2 for file encoding conversion linux/windows has made my life a lot easier!

  8. Jeff Starr
    Perishable 2007/02/04 9:43 am

    Excellent — glad to be of service! Thank you for the positive feedback.

  9. And while you are at it, install notepad++ … a GNU text editor that is like notepad on steroids! :)

  10. Since the hosts file is the only such extensionless file i want to edit, I simply created a hostsx.bat file to bring it up in notepad and I don’t have to go into any folder to find it either.

  11. Jeff Starr
    Perishable 2007/03/27 7:57 am

    David,
    That sounds like a great idea! Perhaps you would be so kind as to share the .bat code (no pun intended)?
    Jeff

  12. The bat file (hostsx.bat) I use in Win 2000 is:
    notepad C:WINNTsystem32driversetchosts

    Best reference and suggested entries for hosts file:
    http://www.mvps.org/winhelp2002/hosts.htm

    Where hosts file resides:
    Windows Vista = C:WINDOWSSYSTEM32DRIVERSETC
    Windows XP = C:WINDOWSSYSTEM32DRIVERSETC
    Windows 2K = C:WINNTSYSTEM32DRIVERSETC
    Win 98/ME = C:WINDOWS

Comments are closed for this post. Something to add? Let me know.
Welcome
Perishable Press is operated by Jeff Starr, a professional web developer and book author with two decades of experience. Here you will find posts about web development, WordPress, security, and more »
The Tao of WordPress: Master the art of WordPress.
Thoughts
LOL @ “weekly” support: “Your request has been received and will be reviewed soon. Neil (your support guy) checks support requests weekly. Rest assured we’ll get to it!” — Gotta be kidding with this.
After several days of work, finally taking a break. If anyone needs me, I'll be in Zora’s Domain, working thru Mah Eliya shrine.
Never ever call the client a useless idiot. Even if it’s true.
Inevitable that Google shuts down Feedburner. Maybe this year? Who knows. Here is a nice summary plus alternatives.
There is no way that Marvel can serve up anything better than what they've already done with Infinity saga/Endgame. Knowhere to go but down, sadly.
I built a new search launchpad to make my life easier. So I can search multiple engines quickly and easily.
Updating all muh plugins for WP 5.5 imminent release! Wut August :)
Newsletter
Get news, updates, deals & tips via email.
Email kept private. Easy unsubscribe anytime.