Home » Questions » Computers [ Ask a new question ]

How can I add an item to the 'new' context menu?

How can I add an item to the 'new' context menu?

When I right click anywhere I get an option to add a new file with a specified extension. I would like to add some custom files into this menu, so I can right click and create a new PHP file for instance.

Asked by: Guest | Views: 275
Total answers/comments: 5
Guest [Entry]

"To add extensions of your choice to the list: create a file, add the content below, save it as whatever.reg, and run it.

Note: Replace .png with the file extension you want to add and replace whatever with anything you want.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.png\ShellNew]
""NullFile""=""""

Source"
Guest [Entry]

"Go in to registry editor and expand HKEY_CLASSES_ROOT

Go to .file_extention

and create a key called ShellNew

Inside that, create a new string key called NullFile with no value

For example, if I wanted to create a new entry for a blank .wil object* I would create

[HKEY_CLASSES_ROOT\.wil\ShellNew]
NullFile = """"

*if the file extension such as .wil does not exist, I would first create a file with that extension and double click it. Open it with the program of my choice as this would then create the other needed registry keys and make your job easier."
Guest [Entry]

"For removing entries from the list, here is a program which allows you to enable/disable entries from a GUI. Much easier than searching the registry!

Unfortunately, it does not allow you to add entries."
Guest [Entry]

"None of these methods were working for me in Windows 10.

I finally found this page that explained that you need to reference another key that contains the name and default icon.

This is the minimum needed to create an entry, but it won't have an icon.

NOTE: the third entry is for a new key textfile referenced in the (Default) value of .txt

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.txt]
@=""textfile""

[HKEY_CLASSES_ROOT\.txt\ShellNew]
""NullFile""=""""

[HKEY_CLASSES_ROOT\textfile]
@=""Text Document""

Here are two ways to specify an icon

Tell Explorer to use the default icon for the content type:

[HKEY_CLASSES_ROOT\.txt]
@=""textfile""
""Content Type""=""text/plain""
""PerceivedType""=""text""

or 2. Specify an icon under textfile like so:

[HKEY_CLASSES_ROOT\textfile\DefaultIcon]
@=""%SystemRoot%\\system32\\imageres.dll,-102""

Oh, and at least for me, just closing and reopening Explorer (make sure to close all instances) is enough to reload the context menu. You don't need to restart the whole machine."
Guest [Entry]

You didn't say what version of Windows you're using--if it's XP you can download the TweakUI PowerToy from Microsoft (also covered in Wikipedia). Click on Templates and add/remove file types to your heart's content. Here's what it looks like: