Programming4us
         
 
 
Windows

Windows 7 : Customizing the New Menu

11/16/2010 3:24:31 PM
One of Windows 7’s handiest features is the New menu, which enables you to create a new file without working within an application. In Windows Explorer (or on the desktop), right-click an empty part of the folder and then select New. In the submenu that appears, you’ll see items that create new documents of various file types, including a folder, shortcut, bitmap image, WordPad document, text document, compressed folder, and possibly many others, depending on your system configuration and the applications you have installed.

What mechanism determines whether a file type appears on the New menu? The Registry, of course. To see how this works, start the Registry Editor and open the HKEY_CLASSES_ROOT key. As you’ve seen, most of the extension subkeys have only a Default setting that’s either blank (if the extension isn’t associated with a registered file type) or a string that points to the extension’s associated file type.

However, many of these extension keys also have subkeys, and a few of them have a subkey named ShellNew, in particular. For example, open the .bmp key and you see that it has a subkey named ShellNew. This subkey is what determines whether a file type appears on the New menu. Specifically, if the extension is registered with Windows 7 and it has a ShellNew subkey, the New menu sprouts a command for the associated file type.

The ShellNew subkey always contains a setting that determines how Windows 7 creates the new file. Four settings are possible:

NullFileThis setting, the value of which is always set to a null string (“”), tells Windows 7 to create an empty file of the associated type. Of the file types that appear on the default New menu, three use the NullFile setting: Text Document (.txt), Bitmap Image (.bmp), and Shortcut (.lnk).
DirectoryThis setting tells Windows 7 to create a folder. The New menu’s Briefcase (see the Briefcase\ShellNew key in the Registry) command uses this setting.
CommandThis setting tells Windows 7 to create the new file by executing a specific command. This command usually invokes an executable file with a few parameters. Two of the New menu’s commands use this setting:
  • Contact—The .contact\ShellNew key contains the following value for the Command setting:

    "%ProgramFiles%\Windows Mail\Wab.exe" /CreateContact "%1"
  • Journal Document—In the .jnt\jntfile\ShellNew key, you’ll see the following value for the Command setting:

    "%ProgramFiles%\Windows Journal\Journal.exe" /n 0
DataThis setting contains a value, and when Windows 7 creates the new file, it copies this value into the file. The New menu’s Rich Text Document (.rtf) and Compressed (Zipped) Folder (.zip) commands use this setting.

Adding File Types to the New Menu

To make the New menu even more convenient, you can add new file types for documents you work with regularly. For any file type that’s registered with Windows 7, you follow a simple three-step process:

1.
Add a ShellNew subkey to the appropriate extension key in HKEY_CLASSES_ROOT.

2.
Add one of the four settings discussed in the preceding section (NullFile, Directory, Command, or Data).

3.
Type a value for the setting.

In most cases, the easiest way to go is to use NullFile to create an empty file.

Deleting File Types from the New Menu

Many Windows 7 applications (such as Microsoft Office) like to add their file types to the New menu. If you find that your New menu is getting overcrowded, you can delete some commands to keep things manageable. To do this, you need to find the appropriate extension in the Registry and delete its ShellNew subkey.

Caution

Instead of permanently deleting a ShellNew subkey, you can tread a more cautious path by simply renaming the key (to, for example, ShellNewOld). This still prevents Windows 7 from adding the item to the New menu, but it also means that you can restore the item just by restoring the original key name. Note, however, that some third-party Registry cleanup programs flag such renamed keys for deletion or restoration. The better programs—such as Registry Mechanic (www.pctools.com)—enable you to specify keys that the program should ignore.

Other -----------------
- Windows 7 : Creating a New File Type
- Windows Vista - Sharing Files and Folders : Accessing a Shared Folder
- Windows Vista - Sharing Files and Folders : Standard Sharing
- Windows Vista - Sharing Files and Folders : Public Folder
- Windows Vista - Sharing Files and Folders : Network Discovery and Browsing
- Windows 7 : Manage Your Network - Working with a Homegroup
- Windows 7 : Manage Your Network - Creating a Homegroup
- Windows 7 : Manage Your Network - Connecting to a Network
- Multibooting Windows 7
- Windows 7 Customization : Working with Existing File Types
- Windows 7 Customization : Understanding File Types
- Windows Azure Service Life Cycle
- Backing Up and Restoring with ntbackup
- Windows Azure Service Management
- Windows Azure : Content Delivery Network
- Windows Azure Storage Services
- Windows Azure Storage Characteristics
- Microsoft Windows Vista : Using Parental Controls to Restrict Computer Usage
- Microsoft Windows Vista : Creating and Enforcing Bulletproof Passwords
- Windows 7 Customization : Taking Ownership of Your Files
 
 
Most View
- Sharepoint 2010 : Backup and Restore (part 1) - Recycle Bin settings in Central Administration
- Encryption basics for SQL Server : Cryptographic Keys
- Working with Search Page Layouts : Adding Navigation to the Search Center (part 1) - Adding Home and Back Buttons to the Search Result Page
- Programming Windows Azure : Table Operations - Understanding Pagination
- Windows 7 : Scripting Windows with PowerShell - Getting Started with PowerShell
- Exchange Server 2010 Mailbox Services Configuration (part 4) - Client Configuration
- Windows Phone 7 : Using the Touch Screen (part 3) - Sprite Hit Testing - Rectangular Hit Tests
- Microsoft ASP.NET 4 : Ajax - Extender Controls (part 2) - A Modal Pop-up Dialog-Style Component
- Relevant IAM Standards and Protocols for Cloud Services (part 1)
- Windows 7 : Accessing a Shared Printer
Top 10
- Implementing Edge Services for an Exchange Server 2007 Environment : Utilizing the Basic Sender and Recipient Connection Filters (part 3) - Configuring Recipient Filtering
- Implementing Edge Services for an Exchange Server 2007 Environment : Utilizing the Basic Sender and Recipient Connection Filters (part 2)
- Implementing Edge Services for an Exchange Server 2007 Environment : Utilizing the Basic Sender and Recipient Connection Filters (part 1)
- Implementing Edge Services for an Exchange Server 2007 Environment : Installing and Configuring the Edge Transport Server Components
- What's New in SharePoint 2013 (part 7) - BCS
- What's New in SharePoint 2013 (part 6) - SEARCH
- What's New in SharePoint 2013 (part 6) - WEB CONTENT MANAGEMENT
- What's New in SharePoint 2013 (part 5) - ENTERPRISE CONTENT MANAGEMENT
- What's New in SharePoint 2013 (part 4) - WORKFLOWS
- What's New in SharePoint 2013 (part 3) - REMOTE EVENTS