How to Open Unknown File Types in Notepad by default

Whenever you double click on a file of unknown type, Windows normally asks for the program it should open this file. It is not a safe practice to open these files of unknown types as they may harm your computer.  A registry change can configure Windows to open unknown file types in Notepad by default, which will keep your computer safe from malicious executables. Later, You always have an option of selecting a suitable program and declare it as the default application for that particular file type by using the context menu ‘Open with’.

In Vista and Windows 7 you must keep the [Shift] key pressed while invoking the context menu to be able to execute the command. In XP, open ‘Run’ in the Start Menu, type ‘regedit’ and press the enter key. In Vista you give the command directly in the search field of the Start Menu. If necessary confirm the request for the user account control and navigate to the key


In the right part of the window double click on the string ‘default’ for processing. Replace the system command in the selection dialog with the command for a suitable editor, for example, C:\Windows\notepad.exe %1. You can also use any other editor, provided they are installed. For example, if you want to include the freeware Notepad++

C:\Program files\Notepad++\notepad++.exe %1

In each case give the complete path to the program file and add the argument ‘%1’ at the end of the command line to include the clicked file.

Note: A space must be given between the program file and the argument. Then click on ‘OK’ and close the registry.

Filed under: OS Tweaks & Hacks
Tags: , , , , , ,
July 12, 2010 by: Prasanth Chandra

Leave a Reply