General discussion

Locked

Open unknown file extension with Notepad

By Darren1959 ·
I am using WindowsXP. I need to be able to open a file by double-clicking on it in Explorer and if WindowsXP does not have a registered program for that file extension, say filename.101, it will attempt to open the file by default with Notepad.

This conversation is currently closed to new comments.

10 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Open unknown file extension with Notepad

by XpertDragon In reply to Open unknown file extensi ...

Exactly what are you asking here? You want a different program association for that file? What is the exact extension of the file you are trying to open? It is normal for Windows to use a default text editor to open up unrecognized files, with strange extensions. Opening up a file with Notepad, if not a large binary file, puts the file into two separate categories (Binary or ASCII/Text). Most of the time, if you see Garbage, chances are it is a binary or executable file, or you may actuallysee text code or instructions, like with a *.BAT file.

The best advice is to use caution when opening files with strange extensions, and to know its ORGIN....where did it come from....who gave it to you....where was it downloaded from....etc.

Paul M. Chavez

Collapse -

Open unknown file extension with Notepad

by Darren1959 In reply to Open unknown file extensi ...

Poster rated this answer

Collapse -

Open unknown file extension with Notepad

by Darren1959 In reply to Open unknown file extensi ...

"It is normal for Windows to use a default text editor to open up unrecognized files, with strange extensions". This is not true. If Windows does not know how to handle a file it will ask you what program to use and offer to always use that program to open files with the exact extension. I need to configure WindowsXP to always use Notepad to open a file if there is no registered program associated with the extension.

Collapse -

Open unknown file extension with Notepad

by Alpha-Male In reply to Open unknown file extensi ...

Usually when this happens, the first time you tried to read the file you were asked of you wanted to open it with notepad (or selected notepad) and had the "always use this program to open this file" checked.

What you can do is go under view, options, file types and delete the association or change it to what you want it to associate with.

In many cases, installing the correct software to view the file type in question will register the extension and set it up to work correctly.

For example, if you're trying to open a .RAR file and you install WinRAR, or a .ZIP file and install WinZip, it will automatically open the file correctly afterward.

If the file does not have the correct extension (ie. it's .101 as you mentioned) you'll need to find out what kind of file it is, then install the appropriate software. If where the file came from does not specify a file type and you don't know, you may be able to look at it in Notepad or a Hex Editor and spot the file type in the header. Hope this helps....

Good Luck!

Collapse -

Open unknown file extension with Notepad

by Darren1959 In reply to Open unknown file extensi ...

I am aware of all this but thanks for replying.

Collapse -

Open unknown file extension with Notepad

by timwalsh In reply to Open unknown file extensi ...

I understand what you are trying to do, but unfortunately, you can't do it. In order to get a specific program to open any specific file type requires a file association. Obviously, multiple file types can be associated with a given program, but each file type requires a specific (and separate) association.

In order to do what you want, you would have to create an assocition along the lines of a wildcard (*.*)(i.e. open anything) with an exception list (i.e. except anything that is alreadyassociated).

Unfortunately, there is no way from within Windows to do this. You would have to write a custom application using VB or VC++ to do this for you.

Collapse -

Open unknown file extension with Notepad

by Darren1959 In reply to Open unknown file extensi ...

Poster rated this answer

Collapse -

Open unknown file extension with Notepad

by Gigelul In reply to Open unknown file extensi ...

Try if these works in WinXP:
Follow these steps to make Notepad the default program that opens all files with unknown extensions in Windows NT:

1.Open the Registry Editor (Regedit.exe).
2.Go to HKEY_CLASSES_ROOT\Unknown\shell.
3.On the Edit menu, select New | Key and then create an ?open? key.
4.In the open key, create a new ?command? key.
5.Click the Default value in the command key and type notepad.exe %1.
6.Exit the Registry Editor.

The next time a file with an unknown extension is selected, NT will open it inside Notepad.

Collapse -

Open unknown file extension with Notepad

by Darren1959 In reply to Open unknown file extensi ...

This is the best response so far but I have already tested this registry edit on my XP machine and it doesn't work ... no surprise here though.

Thank you.

Collapse -

Open unknown file extension with Notepad

by les In reply to Open unknown file extensi ...

Try this regedit.
Gives you the option of a doubleclick to open in notepad or a right click open with notepad.

Easily Use Notepad to Open a File (All Versions)
Enabling this setting will allow you to use Notepad to open a file by simply right clicking on the icon. Also the Notepad will be used to open the files by default if no association already exists.
Open your registry and find the key "HKEY_CLASSES_ROOT\*\shell", if it doesn't already exist then create it.

Under shell create anew key called open, and edit the string "(Default)" to read "Open With Notepad".

Under open create a new key called command, and edit the string "(Default)" to read "notepad.exe %1".

Now when you right click on a file you should see "Open with Notepad" as one of the options.

Note: This tweak may affect the Office 97 toolbar feature and stop it from working correctly. This is because when you click an icon on the Office toolbar it activates the first context menu item, which in thiscase is the new "Open with Notepad" command, rather than looking for the default item.

Back to Windows Forum
10 total posts (Page 1 of 1)  

Related Discussions

Related Forums