When you’re using Windows Explorer to set up a project skeleton for a new project the “New” context menu within Explorer can really help productivity. Being able to create blank files of the proper type can save time and aggravation. The only problem is that the “new” menu not easy to alter and the default entries are less than helpful sometimes.
The first time I looked into changing things around I searched the Windows folder looking for a simple answer. I figured there was a folder there that I could just add files to at least extend the menu, and there was. But simply dumping a file into the folder didn’t do anything. So after searching the Internet and combing through a few message boards and forums I came up with a solution.
You alter the Windows Explorer “New” menu by altering the registry. Instead of opening up regedit.exe and changing every entry, its best to use a registry script. Registry scripts are really simple scripts that alter the registry in some specific way. Comments are hash marks, keys are surrounded in brackets, and values are entered below. You remove the values under a key by preceding the key path with a minus sign. Registry scripts have the.reg file extension. Not too hard to figure out at all.
The script below is the end result. Its well commented as to make it easy for anyone to figure out and alter. The script works off of the file extension of the type of file in the menu. For example, below .txt or .html keys in HKEY_CLASSES_ROOT is the ShellNew key where you alter the values. If the ShellNew key does not exist for a particular file extension you can create it if you want to add that filetype to the menu. An empty NullValue entry below that key will create an empty file with that extension when you click it in the menu. If you want to set up a template, you can by creating one in the C:\Windows\ShellNew folder and enter a FileName value entry with the file name. This especially comes in handy when you usually create one type of HTML document all of the time and you would like to get the boilerplate code out of the way.
Save the code below (after you alter it to suit your needs) as addnewmenu.reg and double click in Windows Explorer to run (you’ll need admin rights).
Windows Registry Editor Version 5.00 # Creates and removes add-new explorer menu entries # NullFile creates an empty file with that extension # FileName allows you to create a template file in # C:\Windows\ShellNew. (use one or the other) # Commenting both subentries and adding a minus (-) # before the registry key (inside the brackets) # removes it from the menu. # Ex: # [-HKEY_CLASSES_ROOT\.html\ShellNew] [HKEY_CLASSES_ROOT\.html\ShellNew] #"NullFile"="" "FileName"="html.html" [HKEY_CLASSES_ROOT\.js\ShellNew] #"NullFile"="" "FileName"="js.js" [HKEY_CLASSES_ROOT\.css\ShellNew] #"NullFile"="" "FileName"="css.css" [HKEY_CLASSES_ROOT\.php\ShellNew] #"NullFile"="" "FileName"="php.php" # Get rid of the entries I don't use [-HKEY_CLASSES_ROOT\Briefcase\ShellNew] [-HKEY_CLASSES_ROOT\.zip\CompressedFolder\ShellNew] [-HKEY_CLASSES_ROOT\.txt\ShellNew] [-HKEY_CLASSES_ROOT\.rtf\ShellNew] [-HKEY_CLASSES_ROOT\.lnk\ShellNew] [-HKEY_CLASSES_ROOT\.jnt\jntfile\ShellNew] [-HKEY_CLASSES_ROOT\.contact\ShellNew] [-HKEY_CLASSES_ROOT\.wlcshrtctv2\LiveCall\ShellNew]