IT tutorials
 
Windows
 

Windows Vista : Mastering File Types - Associating Two or More Extensions with a Single File Type, Customizing the New Menu

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
12/25/2012 11:19:11 AM

1. Creating a New File Type

Windows Vista comes with a long list of registered file types, but it can’t account for every extension you’ll face in your computing career. For rare extensions, it’s best just to use the Open With dialog box. However, if you have an unregistered extension that you encounter frequently, you should register that extension by creating a new file type for it.

Tip

Text files, in particular, seem to come with all kinds of nonstandard (that is, unregistered) extensions. Rather than constantly setting up file types for these extensions or using the Open With dialog box, I created a shortcut for Notepad in my %USERPROFILE\SendTo folder. That way, I can open any text file by right-clicking it and then selecting Send To, Notepad.


Our old friend the Open With dialog box provides a quick-and-dirty method for creating a simple file type for an unregistered extension:

1.
In Windows Explorer, select the file you want to work with.

2.
Click Open. (For unregistered file types, Windows Vista doesn’t display the Open With command.) Vista displays a dialog box telling you that it cannot open the file.

3.
Activate the Select a Program from a List of Installed Programs option and then click OK. The Open With dialog box appears.

4.
Select the application you want to use to open the file or click Browse to choose the program from a dialog box.

5.
Use the Type a Description That You Want to Use for this Kind of File text box to enter a description for the new file type.

6.
Make sure that the Always Use the Selected Program to Open This Kind of File check box is activated.

7.
Click OK.

This method creates a new file type with the following properties:

  • The number of actions Windows Vista creates for the file type depends on the application you selected. If you can use the application to both display and edit the file, Windows Vista creates Open and Edit actions; if you can use the application only to display the file, Windows Vista creates just the Open action.

  • The icon associated with the file is the same as the one used by the associated application.

  • In the Registry, you see the extension in HKEY_CLASSES_ROOT and the associated file type name is ext_auto_file, where ext is the file’s extension.


2. Associating Two or More Extensions with a Single File Type

The problem with creating a new file type is that you often have to reinvent the wheel. For example, let’s say you want to set up a new file type that uses the .1st extension. These are usually text files (such as readme.1st) that provide pre-installation instructions, so you probably want to associate them with Notepad. However, this means repeating some or all of the existing Text Document file types. To avoid this, it’s possible to tell Windows Vista to associate a second extension with an existing file type. Here are the steps to follow:

1.
Open the Registry Editor.

2.
Select the HKEY_CLASSES_ROOT key.

3.
Select Edit, New, Key.

4.
Type the file extension used with the new file type (such as .1st), and press Enter.

5.
In the new file extension key, double-click Default.

6.
Type the name of the existing file type key that you want to associate with the new file type. For example, if you want the new file type to be associated with the Text Document (.txt) file type, enter txtfile.

7.
Click OK.

3. Customizing the New Menu

One of Windows Vista’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 Vista 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 Vista creates the new file. Four settings are possible:

NullFileThis setting, the value of which is always set to a null string (“”), tells Windows Vista 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 Vista 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 Vista 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 Vista 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 Vista, 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 Vista 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 Vista 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.

 
Others
 
- Repairing Windows 8 in 30 Minutes or Less (part 2) - Refreshing Windows 8
- Repairing Windows 8 in 30 Minutes or Less (part 1) - Fixing Common Startup Problems
- Setting Up and Using Home Server Storage : Who Needs Drive Extender? Implementing Spanning, Mirroring, and RAID (part 2) - Mimicking Drive Extender by Creating a RAID 5 Volume
- Setting Up and Using Home Server Storage : Who Needs Drive Extender? Implementing Spanning, Mirroring, and RAID (part 1) - Creating a Storage Pool Using a Spanned Volume
- Finding Your Way Around Windows 8 (part 2)
- Finding Your Way Around Windows 8 (part 1)
- Windows 7 Wireless Networking : Choosing a Network Location
- Windows 7 Wireless Networking : How Do I Know if a Wireless Network Is Secure?
- Windows 7 Wireless Networking : Setting Up a Wireless Network, Viewing and Connecting to Available Wireless Networks
- Windows 8 : Getting Help - To access the Help home page
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us