We recommend using Visual Studio 2017

Registering Verbs for File Name Extensions


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Registering Verbs for File Name Extensions.

The association of a file name extension with an application generally has a preferred action that occurs when a user double-clicks a file. This preferred action is linked to a verb, for example open, that corresponds to the action.

You can register verbs that are associated with a programmatic identifier (ProgID) for an extension by using the Shell key located at HKEY_CLASSES_ROOT\progid\shell. For more information, see File Types.

The operating system recognizes the following standard verbs:

  • Open

  • Edit

  • Play

  • Print

  • Preview

Whenever possible, register a standard verb. The most common choice is the Open verb. Use the Edit verb only if there is a clear difference between opening the file and editing the file. For example, opening an .htm file displays it in the browser, whereas editing an .htm file starts an HTML editor. Standard verbs are localized with the operating system locale.

System_CAPS_ICON_note.jpg Note

When registering standard verbs, do not set the default value for the Open key. The default value contains the display string on the menu. The operating system supplies this string for standard verbs.

Project files should be registered to start a new instance of Visual Studio when a user opens the file. The following example illustrates a standard verb registration for a Visual C# project.

@="C:\\Program Files\\Common Files\\Microsoft Shared\\MSEnv\\VSLauncher.exe \"%1\""  
@="C# Project file"  
@="\"C:\\Program Files\\Common Files\\Microsoft Shared\\MSEnv\\VSLauncher.exe\" \"%1\""  

To open a file in an existing instance of Visual Studio, register a DDEEXEC key. The following example illustrates a standard verb registration for a Visual C# .cs file.

@="C# Source file"  
@="\"C:\\VisualStudioPath\\Common7\\IDE\\devenv.exe\" /dde \"%1\""  

The default verb is the action that is executed when a user double-clicks a file in Windows Explorer. The default verb is the verb specified as the default value for the HKEY_CLASSES_ROOT\progid\Shell key. If no value is specified, the default verb is the first verb specified in the HKEY_CLASSES_ROOT\progid\Shell key list.

System_CAPS_ICON_note.jpg Note

If you plan to change the default verb for an extension in a side-by-side deployment, consider the impact on installation and removal. During installation the original default value is overwritten.

Managing Side-by-Side File Associations